From jwcolby at ColbyConsulting.com Sun Jan 1 19:17:31 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Sun, 1 Jan 2006 20:17:31 -0500 Subject: [dba-VB] VB.net 2005 data sources screwy Message-ID: <200601020117.k021HcV05226@databaseadvisors.com> I have used the Data Sources wizard to build data sources, but they don't display in the data sources window. If I build another, it tells me that the previous one exists, and if I do build another, it is not displayed either. Also, if I drop a data adapter into a form it does so, but immediately says that the data source doesn't exist. Has anyone seen / worked around behavior like this? John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ From jwcolby at ColbyConsulting.com Mon Jan 2 10:48:40 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Mon, 2 Jan 2006 11:48:40 -0500 Subject: [dba-VB] Free Visual Studio e-learning from Microsoft Message-ID: <000401c60fbc$63510440$647aa8c0@ColbyM6805> I just ran across this. http://msdn.microsoft.com/vstudio/learning/elearning_promo/default.aspx It is a limited time offer which expires very soon. One free course. I am examining it further now. John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ From JEHunnicutt at nhcl.med.navy.mil Tue Jan 3 09:33:25 2006 From: JEHunnicutt at nhcl.med.navy.mil (Hunnicutt, Jay E. (Cont)) Date: Tue, 3 Jan 2006 10:33:25 -0500 Subject: [dba-VB] VB.net 2005 data sources screwy Message-ID: <269A811DCC1DD540AC4AF58F59A169C50148A5BF@nh-clnc-exchng2.med.navy.mil> John, If I understand your problem correctly you need to open multiple data sources at the same time. We got around this by creating separate functions to open individual data sources. Their may be a better way but this has worked well for us. Dim cn As SqlConnection Dim cmd As SqlCommand Dim dr As SqlDataReader Dim cn2 As SqlConnection Dim cmd2 As SqlCommand Dim dr2 As SqlDataReader Dim cnmass As SqlConnection Dim cmdmass As SqlCommand Dim drmass As SqlDataReader Sub OpenConnection(strDB as String) If cn Is Nothing Then cn = New SqlConnection( "server=" & SQL_SERVER & ";uid=" & DB_User & ";password=" & DB_Password & ";database=" & strDB ) cn.Open() End If If Not dr Is Nothing Then If Not dr.IsClosed() Then dr.Close() End If End Sub Sub SQL_Select(strDB as String, SQL as String) OpenConnection(strDB) cmd = New SqlCommand( SQL, cn ) cmd.CommandTimeout = 300 dr = cmd.ExecuteReader() End Sub Sub OpenConnection2(strDB as String) If cn2 Is Nothing Then cn2 = New SqlConnection( "server=" & SQL_SERVER & ";uid=" & DB_User & ";password=" & DB_Password & ";database=" & strDB ) cn2.Open() End If If Not dr2 Is Nothing Then If Not dr2.IsClosed() Then dr2.Close() End If End Sub Sub SQL_Select2(strDB as String, SQL as String) OpenConnection2(strDB) cmd2 = New SqlCommand( SQL, cn2 ) cmd2.CommandTimeout = 180 dr2 = cmd2.ExecuteReader() End Sub Sub SQL_NonSelect(strDB as String, SQL as String) OpenConnection(strDB) cmd = New SqlCommand( SQL, cn ) cmd.ExecuteNonQuery() End Sub Sub SQL_NonSelect2(strDB as String, SQL as String) OpenConnection2(strDB) cmd2 = New SqlCommand( SQL, cn2 ) cmd2.ExecuteNonQuery() End Sub Sub CloseConnection() If Not dr Is Nothing Then If Not dr.IsClosed() Then dr.Close() End If cn.Close() cn = Nothing End Sub Sub CloseConnection2() If Not dr2 Is Nothing Then If Not dr2.IsClosed() Then dr2.Close() End If cn2.Close() cn2 = Nothing End Sub Hope this helps you. Jay Hunnicutt -----Original Message----- From: John Colby [mailto:jwcolby at ColbyConsulting.com] Sent: Sunday, January 01, 2006 8:18 PM To: VBA Subject: [dba-VB] VB.net 2005 data sources screwy I have used the Data Sources wizard to build data sources, but they don't display in the data sources window. If I build another, it tells me that the previous one exists, and if I do build another, it is not displayed either. Also, if I drop a data adapter into a form it does so, but immediately says that the data source doesn't exist. Has anyone seen / worked around behavior like this? John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Tue Jan 3 09:40:00 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 10:40:00 -0500 Subject: [dba-VB] VSS 2005 and VB Express 2005 Message-ID: <000901c6107b$f5c6b4e0$647aa8c0@ColbyM6805> Can they both be installed on the same machine at the same time? I have both installed and they both seem to work but I am having screwy problems with data wizards. John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Tue Jan 3 10:44:27 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 11:44:27 -0500 Subject: [dba-VB] Dot Net - messagebox Message-ID: <000e01c61084$f6ab5970$647aa8c0@ColbyM6805> In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Tue Jan 3 11:46:26 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 12:46:26 -0500 Subject: [dba-VB] VB.Net Application settings Message-ID: <001201c6108d$9f568b00$647aa8c0@ColbyM6805> Can the application settings be added programmatically? I have found how to add them manually, but I am not finding a My.Settings.Add or equivalent. These are very similar to my SysVars, though not quite as flexible, but my application needs to be able to add / save / update them at will in order to partially replace SysVars with Settings. John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Tue Jan 3 12:18:37 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 13:18:37 -0500 Subject: [dba-VB] Error using data controls Message-ID: <001601c61092$1e3f6aa0$647aa8c0@ColbyM6805> I am having huge problems using the toolbox to add a data grid to a form. I drag and drop the data grid on the form, and it opens a dialog box which allows me to select the data source. I select an existing source, and a specific table, and the wizard closes, but the error list now contains errors stating that the data source they the WIZARD OFFERED ME (and which does exist in the project) does not exist. If I click on the error I am taken to: Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container Me.DataGridView1 = New System.Windows.Forms.DataGridView Me.C2DbConquestDataSet1 = New C2DbConquest.C2DbConquestDataSet1 Me.TlkpServiceBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.TlkpServiceTableAdapter = New C2DbConquest.C2DbConquestDataSet1TableAdapters.tlkpServiceTableAdapter Where both the New C2DbConquest.C2DbConquestDataSet1 And the New C2DbConquest.C2DbConquestDataSet1TableAdapters.tlkpServiceTableAdapter Are squiggly underlined and claimed to not exist. I can't tell you how many hours I have wasted trying to get this thing to happen. Does anyone have a clue what is going on? John W. Colby www.ColbyConsulting.com From martyconnelly at shaw.ca Tue Jan 3 15:57:02 2006 From: martyconnelly at shaw.ca (MartyConnelly) Date: Tue, 03 Jan 2006 13:57:02 -0800 Subject: [dba-VB] Ado.net 2.0 References: <200512311637.jBVGbxV30372@databaseadvisors.com> Message-ID: <43BAF32E.9020405@shaw.ca> I am assuming you do not want to use the classes from the System.Data.SqlClient namespace, but ADO directly Writing Provider-Independent Data Access Code with ADO.NET 2.0 http://www.devx.com/dotnet/Article/27297 or Streamline your Data Connections by Moving to MARS http://www.devx.com/dbzone/Article/30132 Lots of other articles with code here on ADO.Net 2.0 John Colby wrote: >I am having a hard time getting started with ADO.net 2.0. I need example >code for SOMETHING (anything) that looks up data in a table, preferably in >an sql server db. > >As an example, I have a the "login form" that the wizard builds in VB.Net >2.0. It has two text boxes for username and password, and an OK and Cancel >button. No code. > >I have a user table in a SQL Server database, with a UserName and >PasswordHash field. > >I need to accept the user's input of the username and look it up in the user >table in the SQL, retrieving the passwordhash. > >I can do everything except get the data. Frustrating. I could do it in 1.x >(which still works) but I understand that there is a >"newer/better/faster/easier" way to do this stuff in 2.0. The only problem >is getting examples. As you probably know all anyone is interested in is >binding controls to data which isn't what I want. I need to know how to do >it all in code. > >Eventually (soon thereafter) I will want to pull an entire set of tables, >iterating the tables, populating classes with the data in the tables. The >data in the classes will be changing so I need the classes to be able to >write the data back out to the tables as well. Again, what I need in this >instance is an example, from the start, of dimming all of the objects >required, then reading data out of a given table, and writing data back into >that same table. > >If anyone has example code that they wrote, or a web page that does this >programmatic manipulation, from start to finish, I would be forever >grateful. > >John W. Colby >www.ColbyConsulting.com > >Contribute your unused CPU cycles to a good cause: >http://folding.stanford.edu/ > >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com > > > > > -- Marty Connelly Victoria, B.C. Canada From michael at ddisolutions.com.au Tue Jan 3 16:58:43 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 4 Jan 2006 09:58:43 +1100 Subject: [dba-VB] Dot Net - messagebox Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116A192@ddi-01.DDI.local> Hi John, I've never used VB Express but... This is what I use... Dim result As DialogResult = MessageBox.Show _ ( _ "The application will be terminated...", _ "Application Fatal Error", _ MessageBoxButtons.OK, MessageBoxIcon.Stop, _ MessageBoxDefaultButton.Button1, _ MessageBoxOptions.DefaultDesktopOnly _ ) And it's a member of System.Windows.Forms so, Imports System HTH Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 3:44 AM To: VBA Subject: [dba-VB] Dot Net - messagebox In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Tue Jan 3 17:02:24 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 4 Jan 2006 10:02:24 +1100 Subject: [dba-VB] VB.Net Application settings Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116A193@ddi-01.DDI.local> John, Check out the MS Application blocks. It has a configuration component that you might find useful. If not you will be able to use the other components I guarantee. cheers Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 4:46 AM To: VBA Subject: [dba-VB] VB.Net Application settings Can the application settings be added programmatically? I have found how to add them manually, but I am not finding a My.Settings.Add or equivalent. These are very similar to my SysVars, though not quite as flexible, but my application needs to be able to add / save / update them at will in order to partially replace SysVars with Settings. John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Tue Jan 3 17:38:13 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 18:38:13 -0500 Subject: [dba-VB] Dot Net - messagebox In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D0116A192@ddi-01.DDI.local> Message-ID: <004a01c610be$c42ef440$647aa8c0@ColbyM6805> I tried that and while I could import System, System.Windows was not available. I suspect that it is because this was not a "windows" project, but rather a "class library" project, but I am not sure of that. John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Tuesday, January 03, 2006 5:59 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Dot Net - messagebox Hi John, I've never used VB Express but... This is what I use... Dim result As DialogResult = MessageBox.Show _ ( _ "The application will be terminated...", _ "Application Fatal Error", _ MessageBoxButtons.OK, MessageBoxIcon.Stop, _ MessageBoxDefaultButton.Button1, _ MessageBoxOptions.DefaultDesktopOnly _ ) And it's a member of System.Windows.Forms so, Imports System HTH Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 3:44 AM To: VBA Subject: [dba-VB] Dot Net - messagebox In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Tue Jan 3 18:11:50 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 4 Jan 2006 11:11:50 +1100 Subject: [dba-VB] Dot Net - messagebox Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116A194@ddi-01.DDI.local> Ah, You need to add a reference to System.Windows.Forms.dll I assume the dll will have no interface components (forms etc), why not pass/raise any errors back to the calling function and let it raise the messageboxes if required? cheers Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 10:38 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Dot Net - messagebox I tried that and while I could import System, System.Windows was not available. I suspect that it is because this was not a "windows" project, but rather a "class library" project, but I am not sure of that. John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Tuesday, January 03, 2006 5:59 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Dot Net - messagebox Hi John, I've never used VB Express but... This is what I use... Dim result As DialogResult = MessageBox.Show _ ( _ "The application will be terminated...", _ "Application Fatal Error", _ MessageBoxButtons.OK, MessageBoxIcon.Stop, _ MessageBoxDefaultButton.Button1, _ MessageBoxOptions.DefaultDesktopOnly _ ) And it's a member of System.Windows.Forms so, Imports System HTH Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 3:44 AM To: VBA Subject: [dba-VB] Dot Net - messagebox In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Fri Jan 6 22:24:02 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Fri, 6 Jan 2006 23:24:02 -0500 Subject: [dba-VB] VB Express XML Comments Message-ID: <001501c61342$31b7b490$647aa8c0@ColbyM6805> I have discovered XML comments but don't see the way to turn on publishing them (outputting them at compile time). According to one book it is in the compile tab of the project but I don't find it. Does anyone know how to do this? John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Sun Jan 8 09:58:58 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Sun, 8 Jan 2006 10:58:58 -0500 Subject: [dba-VB] Vb.net - all the recordsets Message-ID: <000001c6146c$71a80ca0$8ad60e05@ColbyM6805> I'm wondering how experienced users of DotNet handle all the recordsets required for real database applications. In Access, you build a query and assign it to a property of a form or data aware control such as a list or combo. Access handles the details. In .Net, at least if you do it in code, you have to do a TON of stuff for each control - connection, command, data table etc. I haven't wrapped my mind around it yet so it probably seems bigger than it really is, but just trying to build one tiny little unbound form... Well... It still ain't workin' yet. Now I like bound as much as anybody but there are just times when... Is anyone out there (on this list?) actually building database apps with this beastie? John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Sun Jan 8 10:24:14 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Sun, 8 Jan 2006 11:24:14 -0500 Subject: [dba-VB] Sensing email items in an outlook folder Message-ID: <001f01c6146f$f79acac0$8ad60e05@ColbyM6805> The following code was working in an Access project for sensing messages in a folder and processing the email. I am trying to build a little application for preparing my spam to be sent off to BlueFrog for reporting. The code is not working from directly inside of Outlook. The code gets here, but the Items collection never contains anything, even when there is email in the folder. Any ideas? Function CheckForSpamMail(fldrSpamIncoming As Outlook.MAPIFolder) As Boolean On Error GoTo Err_CheckForSpamMail Dim msg As Outlook.MailItem Debug.Print fldrSpamIncoming.Name For Each msg In fldrSpamIncoming.Items Debug.Print "CheckForSpamMail - Processing message #" & intMsgCnt; " of " & fldrSpamIncoming.Items.Count ProcessSpamMail fldrSpamIncoming, msg Next msg ' intMsgCntOrig = fldrSpamIncoming.Items.Count ' For intMsgCnt = 1 To intMsgCntOrig ' Set msg = fldrSpamIncoming.Items(1) ' Debug.Print "CheckForSpamMail - Processing message #" & intMsgCnt; " of " & fldrSpamIncoming.Items.Count ' ProcessSpamMail fldrSpamIncoming, msg ' Next intMsgCnt Exit_CheckForSpamMail: On Error Resume Next Set msg = Nothing Exit Function Err_CheckForSpamMail: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case -2147352567 'No messages Resume Exit_CheckForSpamMail Case Else '.All other errors will trap Beep MsgBox Err.Number & ":" & Err.Description, , "Error in Function dclsOutlook.CheckForSpamMail" Resume Exit_CheckForSpamMail End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com From DWUTKA at marlow.com Sun Jan 8 17:19:54 2006 From: DWUTKA at marlow.com (DWUTKA at marlow.com) Date: Sun, 8 Jan 2006 17:19:54 -0600 Subject: [dba-VB] Vb.net - all the recordsets Message-ID: <17724746D360394AA3BFE5B8D40A9C1BD4F4@main2.marlow.com> Nope, just VB6. Drew -----Original Message----- From: John Colby [SMTP:jwcolby at colbyconsulting.com] Sent: Sunday, January 08, 2006 9:59 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Vb.net - all the recordsets I'm wondering how experienced users of DotNet handle all the recordsets required for real database applications. In Access, you build a query and assign it to a property of a form or data aware control such as a list or combo. Access handles the details. In .Net, at least if you do it in code, you have to do a TON of stuff for each control - connection, command, data table etc. I haven't wrapped my mind around it yet so it probably seems bigger than it really is, but just trying to build one tiny little unbound form... Well... It still ain't workin' yet. Now I like bound as much as anybody but there are just times when... Is anyone out there (on this list?) actually building database apps with this beastie? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Mon Jan 9 07:25:42 2006 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Mon, 09 Jan 2006 08:25:42 -0500 Subject: [dba-VB] Vb.net - all the recordsets In-Reply-To: <000001c6146c$71a80ca0$8ad60e05@ColbyM6805> Message-ID: <002e01c61520$315f1710$2f01a8c0@dorismanning> I'm using the beastie to build database apps. I use mostly SQL DataAdapters, DataSets, and DataReaders. You need a DataAdapter for each query but you can stuff the results all in one DataSet. What I really like is the ability to bind the controls of a .Net form to a dataset. Everything is disconnected until I tell the changes to fire back. Feel free to contact me by IM if you need help. Doris Manning mikedorism at verizon.net From R.Griffiths at bury.gov.uk Tue Jan 10 03:27:02 2006 From: R.Griffiths at bury.gov.uk (Griffiths, Richard) Date: Tue, 10 Jan 2006 09:27:02 -0000 Subject: [dba-VB] Vb.net - all the recordsets Message-ID: <200601100915.k0A9Fjr14485@smarthost.yourcomms.net> Hi 'What I really like is the ability to bind the controls of a .Net form to a dataset.' and don't forget, even better IMO, binding to your business class objects allowing rich reusable classes to be built handling all the db updates. Richard -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mike & Doris Manning Sent: 09 January 2006 13:26 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Vb.net - all the recordsets I'm using the beastie to build database apps. I use mostly SQL DataAdapters, DataSets, and DataReaders. You need a DataAdapter for each query but you can stuff the results all in one DataSet. What I really like is the ability to bind the controls of a .Net form to a dataset. Everything is disconnected until I tell the changes to fire back. Feel free to contact me by IM if you need help. Doris Manning mikedorism at verizon.net _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Tue Jan 10 18:12:12 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 10 Jan 2006 19:12:12 -0500 Subject: [dba-VB] VB.Net combo Message-ID: <000501c61643$ac6d9340$647aa8c0@ColbyM6805> I'm trying to set up a combo in VB programmatically. The following is what I am using: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService") cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString cboService.ValueMember = Ds.Tables("cboService").Columns("RA_ID").ToString Return True End Function The function runs to cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString And fails with: "null reference exception was unhandled" I am trying to populate a combo box with two columns of a table, the PK column, and the "display" or text value column. What am I doing wrong? John W. Colby www.ColbyConsulting.com From ebarro at verizon.net Tue Jan 10 18:20:05 2006 From: ebarro at verizon.net (Eric Barro) Date: Tue, 10 Jan 2006 16:20:05 -0800 Subject: [dba-VB] VB.Net combo In-Reply-To: <000501c61643$ac6d9340$647aa8c0@ColbyM6805> Message-ID: <0ISW00BWEJLFA0B1@vms046.mailsrvcs.net> John, Shooting in the dark here because I do most of my development on web apps instead of win32 apps but the syntax should be the same. cboService.DataSource = Ds.Tables("cboService") Probably needs to read as... cboService.DataSource = Ds.Tables("cboService").DefaultView Eric -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Tuesday, January 10, 2006 4:12 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net combo I'm trying to set up a combo in VB programmatically. The following is what I am using: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService") cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString cboService.ValueMember = Ds.Tables("cboService").Columns("RA_ID").ToString Return True End Function The function runs to cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString And fails with: "null reference exception was unhandled" I am trying to populate a combo box with two columns of a table, the PK column, and the "display" or text value column. What am I doing wrong? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ NOD32 1.1359 (20060110) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From jwcolby at ColbyConsulting.com Tue Jan 10 20:34:52 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 10 Jan 2006 21:34:52 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <0ISW00BWEJLFA0B1@vms046.mailsrvcs.net> Message-ID: <000901c61657$9ab4e4f0$647aa8c0@ColbyM6805> Nope, didn't help (or hurt). Just no change. John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Tuesday, January 10, 2006 7:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net combo John, Shooting in the dark here because I do most of my development on web apps instead of win32 apps but the syntax should be the same. cboService.DataSource = Ds.Tables("cboService") Probably needs to read as... cboService.DataSource = Ds.Tables("cboService").DefaultView Eric -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Tuesday, January 10, 2006 4:12 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net combo I'm trying to set up a combo in VB programmatically. The following is what I am using: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService") cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString cboService.ValueMember = Ds.Tables("cboService").Columns("RA_ID").ToString Return True End Function The function runs to cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString And fails with: "null reference exception was unhandled" I am trying to populate a combo box with two columns of a table, the PK column, and the "display" or text value column. What am I doing wrong? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ NOD32 1.1359 (20060110) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Wed Jan 11 07:21:18 2006 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Wed, 11 Jan 2006 08:21:18 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <000501c61643$ac6d9340$647aa8c0@ColbyM6805> Message-ID: <000001c616b1$e9141df0$2f01a8c0@dorismanning> Don't ask where my brain was when we talked about this yesterday. It was obviously way too tired to think straight... The reference to the dataset is already known from the Datasource so all you need to do is directly tie the properties to the fields like this... cboService.DisplayMember = "RA_Rank" cboService.ValueMember = "RA_ID" Doris Manning mikedorism at verizon.net From jwcolby at ColbyConsulting.com Wed Jan 11 08:09:08 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Wed, 11 Jan 2006 09:09:08 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <000001c616b1$e9141df0$2f01a8c0@dorismanning> Message-ID: <001801c616b8$97164350$647aa8c0@ColbyM6805> We're making progress here. The code now is: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService").DefaultView cboService.DisplayMember = "SVC_Service" cboService.ValueMember = "SVC_ID" Return True End Function The combo displays the PK field however, not the Rank string. SVC_ID is the PK, so the value member is being displayed John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mike & Doris Manning Sent: Wednesday, January 11, 2006 8:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net combo Don't ask where my brain was when we talked about this yesterday. It was obviously way too tired to think straight... The reference to the dataset is already known from the Datasource so all you need to do is directly tie the properties to the fields like this... cboService.DisplayMember = "RA_Rank" cboService.ValueMember = "RA_ID" Doris Manning mikedorism at verizon.net _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Wed Jan 11 09:44:18 2006 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Wed, 11 Jan 2006 10:44:18 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <001801c616b8$97164350$647aa8c0@ColbyM6805> Message-ID: <000101c616c5$e3266330$2f01a8c0@dorismanning> Try... cboService.DataSource = Ds cboService.DataMember = "cboService" cboService.DisplayMember = "SVC_Service" cboService.ValueMember = "SVC_ID" Doris Manning mikedorism at verizon.net From listmaster at databaseadvisors.com Thu Jan 12 20:48:24 2006 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Thu, 12 Jan 2006 21:48:24 -0500 Subject: [dba-VB] Administrivia - DBA's New Executive Officers. Message-ID: <43C6CEA8.24082.46E416@listmaster.databaseadvisors.com> The Board of Directors of Database Advisors recently held elections for the executive committee for the upcoming year. The Executive Officers for 2006 are: President: John Bartow Vice-President: Reuben Cummings Secretary: Donna Cook Treasurer: Keith Williamson Congratulations to all. -- Bryan Carbonnell - listmaster at databaseadvisors.com Normal people worry me. From jwcolby at ColbyConsulting.com Sun Jan 1 19:17:31 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Sun, 1 Jan 2006 20:17:31 -0500 Subject: [dba-VB] VB.net 2005 data sources screwy Message-ID: <200601020117.k021HcV05226@databaseadvisors.com> I have used the Data Sources wizard to build data sources, but they don't display in the data sources window. If I build another, it tells me that the previous one exists, and if I do build another, it is not displayed either. Also, if I drop a data adapter into a form it does so, but immediately says that the data source doesn't exist. Has anyone seen / worked around behavior like this? John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ From jwcolby at ColbyConsulting.com Mon Jan 2 10:48:40 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Mon, 2 Jan 2006 11:48:40 -0500 Subject: [dba-VB] Free Visual Studio e-learning from Microsoft Message-ID: <000401c60fbc$63510440$647aa8c0@ColbyM6805> I just ran across this. http://msdn.microsoft.com/vstudio/learning/elearning_promo/default.aspx It is a limited time offer which expires very soon. One free course. I am examining it further now. John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ From JEHunnicutt at nhcl.med.navy.mil Tue Jan 3 09:33:25 2006 From: JEHunnicutt at nhcl.med.navy.mil (Hunnicutt, Jay E. (Cont)) Date: Tue, 3 Jan 2006 10:33:25 -0500 Subject: [dba-VB] VB.net 2005 data sources screwy Message-ID: <269A811DCC1DD540AC4AF58F59A169C50148A5BF@nh-clnc-exchng2.med.navy.mil> John, If I understand your problem correctly you need to open multiple data sources at the same time. We got around this by creating separate functions to open individual data sources. Their may be a better way but this has worked well for us. Dim cn As SqlConnection Dim cmd As SqlCommand Dim dr As SqlDataReader Dim cn2 As SqlConnection Dim cmd2 As SqlCommand Dim dr2 As SqlDataReader Dim cnmass As SqlConnection Dim cmdmass As SqlCommand Dim drmass As SqlDataReader Sub OpenConnection(strDB as String) If cn Is Nothing Then cn = New SqlConnection( "server=" & SQL_SERVER & ";uid=" & DB_User & ";password=" & DB_Password & ";database=" & strDB ) cn.Open() End If If Not dr Is Nothing Then If Not dr.IsClosed() Then dr.Close() End If End Sub Sub SQL_Select(strDB as String, SQL as String) OpenConnection(strDB) cmd = New SqlCommand( SQL, cn ) cmd.CommandTimeout = 300 dr = cmd.ExecuteReader() End Sub Sub OpenConnection2(strDB as String) If cn2 Is Nothing Then cn2 = New SqlConnection( "server=" & SQL_SERVER & ";uid=" & DB_User & ";password=" & DB_Password & ";database=" & strDB ) cn2.Open() End If If Not dr2 Is Nothing Then If Not dr2.IsClosed() Then dr2.Close() End If End Sub Sub SQL_Select2(strDB as String, SQL as String) OpenConnection2(strDB) cmd2 = New SqlCommand( SQL, cn2 ) cmd2.CommandTimeout = 180 dr2 = cmd2.ExecuteReader() End Sub Sub SQL_NonSelect(strDB as String, SQL as String) OpenConnection(strDB) cmd = New SqlCommand( SQL, cn ) cmd.ExecuteNonQuery() End Sub Sub SQL_NonSelect2(strDB as String, SQL as String) OpenConnection2(strDB) cmd2 = New SqlCommand( SQL, cn2 ) cmd2.ExecuteNonQuery() End Sub Sub CloseConnection() If Not dr Is Nothing Then If Not dr.IsClosed() Then dr.Close() End If cn.Close() cn = Nothing End Sub Sub CloseConnection2() If Not dr2 Is Nothing Then If Not dr2.IsClosed() Then dr2.Close() End If cn2.Close() cn2 = Nothing End Sub Hope this helps you. Jay Hunnicutt -----Original Message----- From: John Colby [mailto:jwcolby at ColbyConsulting.com] Sent: Sunday, January 01, 2006 8:18 PM To: VBA Subject: [dba-VB] VB.net 2005 data sources screwy I have used the Data Sources wizard to build data sources, but they don't display in the data sources window. If I build another, it tells me that the previous one exists, and if I do build another, it is not displayed either. Also, if I drop a data adapter into a form it does so, but immediately says that the data source doesn't exist. Has anyone seen / worked around behavior like this? John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Tue Jan 3 09:40:00 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 10:40:00 -0500 Subject: [dba-VB] VSS 2005 and VB Express 2005 Message-ID: <000901c6107b$f5c6b4e0$647aa8c0@ColbyM6805> Can they both be installed on the same machine at the same time? I have both installed and they both seem to work but I am having screwy problems with data wizards. John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Tue Jan 3 10:44:27 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 11:44:27 -0500 Subject: [dba-VB] Dot Net - messagebox Message-ID: <000e01c61084$f6ab5970$647aa8c0@ColbyM6805> In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Tue Jan 3 11:46:26 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 12:46:26 -0500 Subject: [dba-VB] VB.Net Application settings Message-ID: <001201c6108d$9f568b00$647aa8c0@ColbyM6805> Can the application settings be added programmatically? I have found how to add them manually, but I am not finding a My.Settings.Add or equivalent. These are very similar to my SysVars, though not quite as flexible, but my application needs to be able to add / save / update them at will in order to partially replace SysVars with Settings. John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Tue Jan 3 12:18:37 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 13:18:37 -0500 Subject: [dba-VB] Error using data controls Message-ID: <001601c61092$1e3f6aa0$647aa8c0@ColbyM6805> I am having huge problems using the toolbox to add a data grid to a form. I drag and drop the data grid on the form, and it opens a dialog box which allows me to select the data source. I select an existing source, and a specific table, and the wizard closes, but the error list now contains errors stating that the data source they the WIZARD OFFERED ME (and which does exist in the project) does not exist. If I click on the error I am taken to: Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container Me.DataGridView1 = New System.Windows.Forms.DataGridView Me.C2DbConquestDataSet1 = New C2DbConquest.C2DbConquestDataSet1 Me.TlkpServiceBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.TlkpServiceTableAdapter = New C2DbConquest.C2DbConquestDataSet1TableAdapters.tlkpServiceTableAdapter Where both the New C2DbConquest.C2DbConquestDataSet1 And the New C2DbConquest.C2DbConquestDataSet1TableAdapters.tlkpServiceTableAdapter Are squiggly underlined and claimed to not exist. I can't tell you how many hours I have wasted trying to get this thing to happen. Does anyone have a clue what is going on? John W. Colby www.ColbyConsulting.com From martyconnelly at shaw.ca Tue Jan 3 15:57:02 2006 From: martyconnelly at shaw.ca (MartyConnelly) Date: Tue, 03 Jan 2006 13:57:02 -0800 Subject: [dba-VB] Ado.net 2.0 References: <200512311637.jBVGbxV30372@databaseadvisors.com> Message-ID: <43BAF32E.9020405@shaw.ca> I am assuming you do not want to use the classes from the System.Data.SqlClient namespace, but ADO directly Writing Provider-Independent Data Access Code with ADO.NET 2.0 http://www.devx.com/dotnet/Article/27297 or Streamline your Data Connections by Moving to MARS http://www.devx.com/dbzone/Article/30132 Lots of other articles with code here on ADO.Net 2.0 John Colby wrote: >I am having a hard time getting started with ADO.net 2.0. I need example >code for SOMETHING (anything) that looks up data in a table, preferably in >an sql server db. > >As an example, I have a the "login form" that the wizard builds in VB.Net >2.0. It has two text boxes for username and password, and an OK and Cancel >button. No code. > >I have a user table in a SQL Server database, with a UserName and >PasswordHash field. > >I need to accept the user's input of the username and look it up in the user >table in the SQL, retrieving the passwordhash. > >I can do everything except get the data. Frustrating. I could do it in 1.x >(which still works) but I understand that there is a >"newer/better/faster/easier" way to do this stuff in 2.0. The only problem >is getting examples. As you probably know all anyone is interested in is >binding controls to data which isn't what I want. I need to know how to do >it all in code. > >Eventually (soon thereafter) I will want to pull an entire set of tables, >iterating the tables, populating classes with the data in the tables. The >data in the classes will be changing so I need the classes to be able to >write the data back out to the tables as well. Again, what I need in this >instance is an example, from the start, of dimming all of the objects >required, then reading data out of a given table, and writing data back into >that same table. > >If anyone has example code that they wrote, or a web page that does this >programmatic manipulation, from start to finish, I would be forever >grateful. > >John W. Colby >www.ColbyConsulting.com > >Contribute your unused CPU cycles to a good cause: >http://folding.stanford.edu/ > >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com > > > > > -- Marty Connelly Victoria, B.C. Canada From michael at ddisolutions.com.au Tue Jan 3 16:58:43 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 4 Jan 2006 09:58:43 +1100 Subject: [dba-VB] Dot Net - messagebox Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116A192@ddi-01.DDI.local> Hi John, I've never used VB Express but... This is what I use... Dim result As DialogResult = MessageBox.Show _ ( _ "The application will be terminated...", _ "Application Fatal Error", _ MessageBoxButtons.OK, MessageBoxIcon.Stop, _ MessageBoxDefaultButton.Button1, _ MessageBoxOptions.DefaultDesktopOnly _ ) And it's a member of System.Windows.Forms so, Imports System HTH Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 3:44 AM To: VBA Subject: [dba-VB] Dot Net - messagebox In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Tue Jan 3 17:02:24 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 4 Jan 2006 10:02:24 +1100 Subject: [dba-VB] VB.Net Application settings Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116A193@ddi-01.DDI.local> John, Check out the MS Application blocks. It has a configuration component that you might find useful. If not you will be able to use the other components I guarantee. cheers Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 4:46 AM To: VBA Subject: [dba-VB] VB.Net Application settings Can the application settings be added programmatically? I have found how to add them manually, but I am not finding a My.Settings.Add or equivalent. These are very similar to my SysVars, though not quite as flexible, but my application needs to be able to add / save / update them at will in order to partially replace SysVars with Settings. John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Tue Jan 3 17:38:13 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 18:38:13 -0500 Subject: [dba-VB] Dot Net - messagebox In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D0116A192@ddi-01.DDI.local> Message-ID: <004a01c610be$c42ef440$647aa8c0@ColbyM6805> I tried that and while I could import System, System.Windows was not available. I suspect that it is because this was not a "windows" project, but rather a "class library" project, but I am not sure of that. John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Tuesday, January 03, 2006 5:59 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Dot Net - messagebox Hi John, I've never used VB Express but... This is what I use... Dim result As DialogResult = MessageBox.Show _ ( _ "The application will be terminated...", _ "Application Fatal Error", _ MessageBoxButtons.OK, MessageBoxIcon.Stop, _ MessageBoxDefaultButton.Button1, _ MessageBoxOptions.DefaultDesktopOnly _ ) And it's a member of System.Windows.Forms so, Imports System HTH Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 3:44 AM To: VBA Subject: [dba-VB] Dot Net - messagebox In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Tue Jan 3 18:11:50 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 4 Jan 2006 11:11:50 +1100 Subject: [dba-VB] Dot Net - messagebox Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116A194@ddi-01.DDI.local> Ah, You need to add a reference to System.Windows.Forms.dll I assume the dll will have no interface components (forms etc), why not pass/raise any errors back to the calling function and let it raise the messageboxes if required? cheers Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 10:38 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Dot Net - messagebox I tried that and while I could import System, System.Windows was not available. I suspect that it is because this was not a "windows" project, but rather a "class library" project, but I am not sure of that. John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Tuesday, January 03, 2006 5:59 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Dot Net - messagebox Hi John, I've never used VB Express but... This is what I use... Dim result As DialogResult = MessageBox.Show _ ( _ "The application will be terminated...", _ "Application Fatal Error", _ MessageBoxButtons.OK, MessageBoxIcon.Stop, _ MessageBoxDefaultButton.Button1, _ MessageBoxOptions.DefaultDesktopOnly _ ) And it's a member of System.Windows.Forms so, Imports System HTH Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 3:44 AM To: VBA Subject: [dba-VB] Dot Net - messagebox In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Fri Jan 6 22:24:02 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Fri, 6 Jan 2006 23:24:02 -0500 Subject: [dba-VB] VB Express XML Comments Message-ID: <001501c61342$31b7b490$647aa8c0@ColbyM6805> I have discovered XML comments but don't see the way to turn on publishing them (outputting them at compile time). According to one book it is in the compile tab of the project but I don't find it. Does anyone know how to do this? John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Sun Jan 8 09:58:58 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Sun, 8 Jan 2006 10:58:58 -0500 Subject: [dba-VB] Vb.net - all the recordsets Message-ID: <000001c6146c$71a80ca0$8ad60e05@ColbyM6805> I'm wondering how experienced users of DotNet handle all the recordsets required for real database applications. In Access, you build a query and assign it to a property of a form or data aware control such as a list or combo. Access handles the details. In .Net, at least if you do it in code, you have to do a TON of stuff for each control - connection, command, data table etc. I haven't wrapped my mind around it yet so it probably seems bigger than it really is, but just trying to build one tiny little unbound form... Well... It still ain't workin' yet. Now I like bound as much as anybody but there are just times when... Is anyone out there (on this list?) actually building database apps with this beastie? John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Sun Jan 8 10:24:14 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Sun, 8 Jan 2006 11:24:14 -0500 Subject: [dba-VB] Sensing email items in an outlook folder Message-ID: <001f01c6146f$f79acac0$8ad60e05@ColbyM6805> The following code was working in an Access project for sensing messages in a folder and processing the email. I am trying to build a little application for preparing my spam to be sent off to BlueFrog for reporting. The code is not working from directly inside of Outlook. The code gets here, but the Items collection never contains anything, even when there is email in the folder. Any ideas? Function CheckForSpamMail(fldrSpamIncoming As Outlook.MAPIFolder) As Boolean On Error GoTo Err_CheckForSpamMail Dim msg As Outlook.MailItem Debug.Print fldrSpamIncoming.Name For Each msg In fldrSpamIncoming.Items Debug.Print "CheckForSpamMail - Processing message #" & intMsgCnt; " of " & fldrSpamIncoming.Items.Count ProcessSpamMail fldrSpamIncoming, msg Next msg ' intMsgCntOrig = fldrSpamIncoming.Items.Count ' For intMsgCnt = 1 To intMsgCntOrig ' Set msg = fldrSpamIncoming.Items(1) ' Debug.Print "CheckForSpamMail - Processing message #" & intMsgCnt; " of " & fldrSpamIncoming.Items.Count ' ProcessSpamMail fldrSpamIncoming, msg ' Next intMsgCnt Exit_CheckForSpamMail: On Error Resume Next Set msg = Nothing Exit Function Err_CheckForSpamMail: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case -2147352567 'No messages Resume Exit_CheckForSpamMail Case Else '.All other errors will trap Beep MsgBox Err.Number & ":" & Err.Description, , "Error in Function dclsOutlook.CheckForSpamMail" Resume Exit_CheckForSpamMail End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com From DWUTKA at marlow.com Sun Jan 8 17:19:54 2006 From: DWUTKA at marlow.com (DWUTKA at marlow.com) Date: Sun, 8 Jan 2006 17:19:54 -0600 Subject: [dba-VB] Vb.net - all the recordsets Message-ID: <17724746D360394AA3BFE5B8D40A9C1BD4F4@main2.marlow.com> Nope, just VB6. Drew -----Original Message----- From: John Colby [SMTP:jwcolby at colbyconsulting.com] Sent: Sunday, January 08, 2006 9:59 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Vb.net - all the recordsets I'm wondering how experienced users of DotNet handle all the recordsets required for real database applications. In Access, you build a query and assign it to a property of a form or data aware control such as a list or combo. Access handles the details. In .Net, at least if you do it in code, you have to do a TON of stuff for each control - connection, command, data table etc. I haven't wrapped my mind around it yet so it probably seems bigger than it really is, but just trying to build one tiny little unbound form... Well... It still ain't workin' yet. Now I like bound as much as anybody but there are just times when... Is anyone out there (on this list?) actually building database apps with this beastie? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Mon Jan 9 07:25:42 2006 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Mon, 09 Jan 2006 08:25:42 -0500 Subject: [dba-VB] Vb.net - all the recordsets In-Reply-To: <000001c6146c$71a80ca0$8ad60e05@ColbyM6805> Message-ID: <002e01c61520$315f1710$2f01a8c0@dorismanning> I'm using the beastie to build database apps. I use mostly SQL DataAdapters, DataSets, and DataReaders. You need a DataAdapter for each query but you can stuff the results all in one DataSet. What I really like is the ability to bind the controls of a .Net form to a dataset. Everything is disconnected until I tell the changes to fire back. Feel free to contact me by IM if you need help. Doris Manning mikedorism at verizon.net From R.Griffiths at bury.gov.uk Tue Jan 10 03:27:02 2006 From: R.Griffiths at bury.gov.uk (Griffiths, Richard) Date: Tue, 10 Jan 2006 09:27:02 -0000 Subject: [dba-VB] Vb.net - all the recordsets Message-ID: <200601100915.k0A9Fjr14485@smarthost.yourcomms.net> Hi 'What I really like is the ability to bind the controls of a .Net form to a dataset.' and don't forget, even better IMO, binding to your business class objects allowing rich reusable classes to be built handling all the db updates. Richard -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mike & Doris Manning Sent: 09 January 2006 13:26 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Vb.net - all the recordsets I'm using the beastie to build database apps. I use mostly SQL DataAdapters, DataSets, and DataReaders. You need a DataAdapter for each query but you can stuff the results all in one DataSet. What I really like is the ability to bind the controls of a .Net form to a dataset. Everything is disconnected until I tell the changes to fire back. Feel free to contact me by IM if you need help. Doris Manning mikedorism at verizon.net _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Tue Jan 10 18:12:12 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 10 Jan 2006 19:12:12 -0500 Subject: [dba-VB] VB.Net combo Message-ID: <000501c61643$ac6d9340$647aa8c0@ColbyM6805> I'm trying to set up a combo in VB programmatically. The following is what I am using: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService") cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString cboService.ValueMember = Ds.Tables("cboService").Columns("RA_ID").ToString Return True End Function The function runs to cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString And fails with: "null reference exception was unhandled" I am trying to populate a combo box with two columns of a table, the PK column, and the "display" or text value column. What am I doing wrong? John W. Colby www.ColbyConsulting.com From ebarro at verizon.net Tue Jan 10 18:20:05 2006 From: ebarro at verizon.net (Eric Barro) Date: Tue, 10 Jan 2006 16:20:05 -0800 Subject: [dba-VB] VB.Net combo In-Reply-To: <000501c61643$ac6d9340$647aa8c0@ColbyM6805> Message-ID: <0ISW00BWEJLFA0B1@vms046.mailsrvcs.net> John, Shooting in the dark here because I do most of my development on web apps instead of win32 apps but the syntax should be the same. cboService.DataSource = Ds.Tables("cboService") Probably needs to read as... cboService.DataSource = Ds.Tables("cboService").DefaultView Eric -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Tuesday, January 10, 2006 4:12 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net combo I'm trying to set up a combo in VB programmatically. The following is what I am using: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService") cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString cboService.ValueMember = Ds.Tables("cboService").Columns("RA_ID").ToString Return True End Function The function runs to cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString And fails with: "null reference exception was unhandled" I am trying to populate a combo box with two columns of a table, the PK column, and the "display" or text value column. What am I doing wrong? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ NOD32 1.1359 (20060110) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From jwcolby at ColbyConsulting.com Tue Jan 10 20:34:52 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 10 Jan 2006 21:34:52 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <0ISW00BWEJLFA0B1@vms046.mailsrvcs.net> Message-ID: <000901c61657$9ab4e4f0$647aa8c0@ColbyM6805> Nope, didn't help (or hurt). Just no change. John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Tuesday, January 10, 2006 7:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net combo John, Shooting in the dark here because I do most of my development on web apps instead of win32 apps but the syntax should be the same. cboService.DataSource = Ds.Tables("cboService") Probably needs to read as... cboService.DataSource = Ds.Tables("cboService").DefaultView Eric -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Tuesday, January 10, 2006 4:12 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net combo I'm trying to set up a combo in VB programmatically. The following is what I am using: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService") cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString cboService.ValueMember = Ds.Tables("cboService").Columns("RA_ID").ToString Return True End Function The function runs to cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString And fails with: "null reference exception was unhandled" I am trying to populate a combo box with two columns of a table, the PK column, and the "display" or text value column. What am I doing wrong? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ NOD32 1.1359 (20060110) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Wed Jan 11 07:21:18 2006 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Wed, 11 Jan 2006 08:21:18 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <000501c61643$ac6d9340$647aa8c0@ColbyM6805> Message-ID: <000001c616b1$e9141df0$2f01a8c0@dorismanning> Don't ask where my brain was when we talked about this yesterday. It was obviously way too tired to think straight... The reference to the dataset is already known from the Datasource so all you need to do is directly tie the properties to the fields like this... cboService.DisplayMember = "RA_Rank" cboService.ValueMember = "RA_ID" Doris Manning mikedorism at verizon.net From jwcolby at ColbyConsulting.com Wed Jan 11 08:09:08 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Wed, 11 Jan 2006 09:09:08 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <000001c616b1$e9141df0$2f01a8c0@dorismanning> Message-ID: <001801c616b8$97164350$647aa8c0@ColbyM6805> We're making progress here. The code now is: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService").DefaultView cboService.DisplayMember = "SVC_Service" cboService.ValueMember = "SVC_ID" Return True End Function The combo displays the PK field however, not the Rank string. SVC_ID is the PK, so the value member is being displayed John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mike & Doris Manning Sent: Wednesday, January 11, 2006 8:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net combo Don't ask where my brain was when we talked about this yesterday. It was obviously way too tired to think straight... The reference to the dataset is already known from the Datasource so all you need to do is directly tie the properties to the fields like this... cboService.DisplayMember = "RA_Rank" cboService.ValueMember = "RA_ID" Doris Manning mikedorism at verizon.net _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Wed Jan 11 09:44:18 2006 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Wed, 11 Jan 2006 10:44:18 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <001801c616b8$97164350$647aa8c0@ColbyM6805> Message-ID: <000101c616c5$e3266330$2f01a8c0@dorismanning> Try... cboService.DataSource = Ds cboService.DataMember = "cboService" cboService.DisplayMember = "SVC_Service" cboService.ValueMember = "SVC_ID" Doris Manning mikedorism at verizon.net From listmaster at databaseadvisors.com Thu Jan 12 20:48:24 2006 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Thu, 12 Jan 2006 21:48:24 -0500 Subject: [dba-VB] Administrivia - DBA's New Executive Officers. Message-ID: <43C6CEA8.24082.46E416@listmaster.databaseadvisors.com> The Board of Directors of Database Advisors recently held elections for the executive committee for the upcoming year. The Executive Officers for 2006 are: President: John Bartow Vice-President: Reuben Cummings Secretary: Donna Cook Treasurer: Keith Williamson Congratulations to all. -- Bryan Carbonnell - listmaster at databaseadvisors.com Normal people worry me. From jwcolby at ColbyConsulting.com Sun Jan 1 19:17:31 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Sun, 1 Jan 2006 20:17:31 -0500 Subject: [dba-VB] VB.net 2005 data sources screwy Message-ID: <200601020117.k021HcV05226@databaseadvisors.com> I have used the Data Sources wizard to build data sources, but they don't display in the data sources window. If I build another, it tells me that the previous one exists, and if I do build another, it is not displayed either. Also, if I drop a data adapter into a form it does so, but immediately says that the data source doesn't exist. Has anyone seen / worked around behavior like this? John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ From jwcolby at ColbyConsulting.com Mon Jan 2 10:48:40 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Mon, 2 Jan 2006 11:48:40 -0500 Subject: [dba-VB] Free Visual Studio e-learning from Microsoft Message-ID: <000401c60fbc$63510440$647aa8c0@ColbyM6805> I just ran across this. http://msdn.microsoft.com/vstudio/learning/elearning_promo/default.aspx It is a limited time offer which expires very soon. One free course. I am examining it further now. John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ From JEHunnicutt at nhcl.med.navy.mil Tue Jan 3 09:33:25 2006 From: JEHunnicutt at nhcl.med.navy.mil (Hunnicutt, Jay E. (Cont)) Date: Tue, 3 Jan 2006 10:33:25 -0500 Subject: [dba-VB] VB.net 2005 data sources screwy Message-ID: <269A811DCC1DD540AC4AF58F59A169C50148A5BF@nh-clnc-exchng2.med.navy.mil> John, If I understand your problem correctly you need to open multiple data sources at the same time. We got around this by creating separate functions to open individual data sources. Their may be a better way but this has worked well for us. Dim cn As SqlConnection Dim cmd As SqlCommand Dim dr As SqlDataReader Dim cn2 As SqlConnection Dim cmd2 As SqlCommand Dim dr2 As SqlDataReader Dim cnmass As SqlConnection Dim cmdmass As SqlCommand Dim drmass As SqlDataReader Sub OpenConnection(strDB as String) If cn Is Nothing Then cn = New SqlConnection( "server=" & SQL_SERVER & ";uid=" & DB_User & ";password=" & DB_Password & ";database=" & strDB ) cn.Open() End If If Not dr Is Nothing Then If Not dr.IsClosed() Then dr.Close() End If End Sub Sub SQL_Select(strDB as String, SQL as String) OpenConnection(strDB) cmd = New SqlCommand( SQL, cn ) cmd.CommandTimeout = 300 dr = cmd.ExecuteReader() End Sub Sub OpenConnection2(strDB as String) If cn2 Is Nothing Then cn2 = New SqlConnection( "server=" & SQL_SERVER & ";uid=" & DB_User & ";password=" & DB_Password & ";database=" & strDB ) cn2.Open() End If If Not dr2 Is Nothing Then If Not dr2.IsClosed() Then dr2.Close() End If End Sub Sub SQL_Select2(strDB as String, SQL as String) OpenConnection2(strDB) cmd2 = New SqlCommand( SQL, cn2 ) cmd2.CommandTimeout = 180 dr2 = cmd2.ExecuteReader() End Sub Sub SQL_NonSelect(strDB as String, SQL as String) OpenConnection(strDB) cmd = New SqlCommand( SQL, cn ) cmd.ExecuteNonQuery() End Sub Sub SQL_NonSelect2(strDB as String, SQL as String) OpenConnection2(strDB) cmd2 = New SqlCommand( SQL, cn2 ) cmd2.ExecuteNonQuery() End Sub Sub CloseConnection() If Not dr Is Nothing Then If Not dr.IsClosed() Then dr.Close() End If cn.Close() cn = Nothing End Sub Sub CloseConnection2() If Not dr2 Is Nothing Then If Not dr2.IsClosed() Then dr2.Close() End If cn2.Close() cn2 = Nothing End Sub Hope this helps you. Jay Hunnicutt -----Original Message----- From: John Colby [mailto:jwcolby at ColbyConsulting.com] Sent: Sunday, January 01, 2006 8:18 PM To: VBA Subject: [dba-VB] VB.net 2005 data sources screwy I have used the Data Sources wizard to build data sources, but they don't display in the data sources window. If I build another, it tells me that the previous one exists, and if I do build another, it is not displayed either. Also, if I drop a data adapter into a form it does so, but immediately says that the data source doesn't exist. Has anyone seen / worked around behavior like this? John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Tue Jan 3 09:40:00 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 10:40:00 -0500 Subject: [dba-VB] VSS 2005 and VB Express 2005 Message-ID: <000901c6107b$f5c6b4e0$647aa8c0@ColbyM6805> Can they both be installed on the same machine at the same time? I have both installed and they both seem to work but I am having screwy problems with data wizards. John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Tue Jan 3 10:44:27 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 11:44:27 -0500 Subject: [dba-VB] Dot Net - messagebox Message-ID: <000e01c61084$f6ab5970$647aa8c0@ColbyM6805> In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Tue Jan 3 11:46:26 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 12:46:26 -0500 Subject: [dba-VB] VB.Net Application settings Message-ID: <001201c6108d$9f568b00$647aa8c0@ColbyM6805> Can the application settings be added programmatically? I have found how to add them manually, but I am not finding a My.Settings.Add or equivalent. These are very similar to my SysVars, though not quite as flexible, but my application needs to be able to add / save / update them at will in order to partially replace SysVars with Settings. John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Tue Jan 3 12:18:37 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 13:18:37 -0500 Subject: [dba-VB] Error using data controls Message-ID: <001601c61092$1e3f6aa0$647aa8c0@ColbyM6805> I am having huge problems using the toolbox to add a data grid to a form. I drag and drop the data grid on the form, and it opens a dialog box which allows me to select the data source. I select an existing source, and a specific table, and the wizard closes, but the error list now contains errors stating that the data source they the WIZARD OFFERED ME (and which does exist in the project) does not exist. If I click on the error I am taken to: Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container Me.DataGridView1 = New System.Windows.Forms.DataGridView Me.C2DbConquestDataSet1 = New C2DbConquest.C2DbConquestDataSet1 Me.TlkpServiceBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.TlkpServiceTableAdapter = New C2DbConquest.C2DbConquestDataSet1TableAdapters.tlkpServiceTableAdapter Where both the New C2DbConquest.C2DbConquestDataSet1 And the New C2DbConquest.C2DbConquestDataSet1TableAdapters.tlkpServiceTableAdapter Are squiggly underlined and claimed to not exist. I can't tell you how many hours I have wasted trying to get this thing to happen. Does anyone have a clue what is going on? John W. Colby www.ColbyConsulting.com From martyconnelly at shaw.ca Tue Jan 3 15:57:02 2006 From: martyconnelly at shaw.ca (MartyConnelly) Date: Tue, 03 Jan 2006 13:57:02 -0800 Subject: [dba-VB] Ado.net 2.0 References: <200512311637.jBVGbxV30372@databaseadvisors.com> Message-ID: <43BAF32E.9020405@shaw.ca> I am assuming you do not want to use the classes from the System.Data.SqlClient namespace, but ADO directly Writing Provider-Independent Data Access Code with ADO.NET 2.0 http://www.devx.com/dotnet/Article/27297 or Streamline your Data Connections by Moving to MARS http://www.devx.com/dbzone/Article/30132 Lots of other articles with code here on ADO.Net 2.0 John Colby wrote: >I am having a hard time getting started with ADO.net 2.0. I need example >code for SOMETHING (anything) that looks up data in a table, preferably in >an sql server db. > >As an example, I have a the "login form" that the wizard builds in VB.Net >2.0. It has two text boxes for username and password, and an OK and Cancel >button. No code. > >I have a user table in a SQL Server database, with a UserName and >PasswordHash field. > >I need to accept the user's input of the username and look it up in the user >table in the SQL, retrieving the passwordhash. > >I can do everything except get the data. Frustrating. I could do it in 1.x >(which still works) but I understand that there is a >"newer/better/faster/easier" way to do this stuff in 2.0. The only problem >is getting examples. As you probably know all anyone is interested in is >binding controls to data which isn't what I want. I need to know how to do >it all in code. > >Eventually (soon thereafter) I will want to pull an entire set of tables, >iterating the tables, populating classes with the data in the tables. The >data in the classes will be changing so I need the classes to be able to >write the data back out to the tables as well. Again, what I need in this >instance is an example, from the start, of dimming all of the objects >required, then reading data out of a given table, and writing data back into >that same table. > >If anyone has example code that they wrote, or a web page that does this >programmatic manipulation, from start to finish, I would be forever >grateful. > >John W. Colby >www.ColbyConsulting.com > >Contribute your unused CPU cycles to a good cause: >http://folding.stanford.edu/ > >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com > > > > > -- Marty Connelly Victoria, B.C. Canada From michael at ddisolutions.com.au Tue Jan 3 16:58:43 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 4 Jan 2006 09:58:43 +1100 Subject: [dba-VB] Dot Net - messagebox Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116A192@ddi-01.DDI.local> Hi John, I've never used VB Express but... This is what I use... Dim result As DialogResult = MessageBox.Show _ ( _ "The application will be terminated...", _ "Application Fatal Error", _ MessageBoxButtons.OK, MessageBoxIcon.Stop, _ MessageBoxDefaultButton.Button1, _ MessageBoxOptions.DefaultDesktopOnly _ ) And it's a member of System.Windows.Forms so, Imports System HTH Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 3:44 AM To: VBA Subject: [dba-VB] Dot Net - messagebox In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Tue Jan 3 17:02:24 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 4 Jan 2006 10:02:24 +1100 Subject: [dba-VB] VB.Net Application settings Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116A193@ddi-01.DDI.local> John, Check out the MS Application blocks. It has a configuration component that you might find useful. If not you will be able to use the other components I guarantee. cheers Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 4:46 AM To: VBA Subject: [dba-VB] VB.Net Application settings Can the application settings be added programmatically? I have found how to add them manually, but I am not finding a My.Settings.Add or equivalent. These are very similar to my SysVars, though not quite as flexible, but my application needs to be able to add / save / update them at will in order to partially replace SysVars with Settings. John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Tue Jan 3 17:38:13 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 18:38:13 -0500 Subject: [dba-VB] Dot Net - messagebox In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D0116A192@ddi-01.DDI.local> Message-ID: <004a01c610be$c42ef440$647aa8c0@ColbyM6805> I tried that and while I could import System, System.Windows was not available. I suspect that it is because this was not a "windows" project, but rather a "class library" project, but I am not sure of that. John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Tuesday, January 03, 2006 5:59 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Dot Net - messagebox Hi John, I've never used VB Express but... This is what I use... Dim result As DialogResult = MessageBox.Show _ ( _ "The application will be terminated...", _ "Application Fatal Error", _ MessageBoxButtons.OK, MessageBoxIcon.Stop, _ MessageBoxDefaultButton.Button1, _ MessageBoxOptions.DefaultDesktopOnly _ ) And it's a member of System.Windows.Forms so, Imports System HTH Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 3:44 AM To: VBA Subject: [dba-VB] Dot Net - messagebox In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Tue Jan 3 18:11:50 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 4 Jan 2006 11:11:50 +1100 Subject: [dba-VB] Dot Net - messagebox Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116A194@ddi-01.DDI.local> Ah, You need to add a reference to System.Windows.Forms.dll I assume the dll will have no interface components (forms etc), why not pass/raise any errors back to the calling function and let it raise the messageboxes if required? cheers Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 10:38 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Dot Net - messagebox I tried that and while I could import System, System.Windows was not available. I suspect that it is because this was not a "windows" project, but rather a "class library" project, but I am not sure of that. John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Tuesday, January 03, 2006 5:59 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Dot Net - messagebox Hi John, I've never used VB Express but... This is what I use... Dim result As DialogResult = MessageBox.Show _ ( _ "The application will be terminated...", _ "Application Fatal Error", _ MessageBoxButtons.OK, MessageBoxIcon.Stop, _ MessageBoxDefaultButton.Button1, _ MessageBoxOptions.DefaultDesktopOnly _ ) And it's a member of System.Windows.Forms so, Imports System HTH Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 3:44 AM To: VBA Subject: [dba-VB] Dot Net - messagebox In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Fri Jan 6 22:24:02 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Fri, 6 Jan 2006 23:24:02 -0500 Subject: [dba-VB] VB Express XML Comments Message-ID: <001501c61342$31b7b490$647aa8c0@ColbyM6805> I have discovered XML comments but don't see the way to turn on publishing them (outputting them at compile time). According to one book it is in the compile tab of the project but I don't find it. Does anyone know how to do this? John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Sun Jan 8 09:58:58 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Sun, 8 Jan 2006 10:58:58 -0500 Subject: [dba-VB] Vb.net - all the recordsets Message-ID: <000001c6146c$71a80ca0$8ad60e05@ColbyM6805> I'm wondering how experienced users of DotNet handle all the recordsets required for real database applications. In Access, you build a query and assign it to a property of a form or data aware control such as a list or combo. Access handles the details. In .Net, at least if you do it in code, you have to do a TON of stuff for each control - connection, command, data table etc. I haven't wrapped my mind around it yet so it probably seems bigger than it really is, but just trying to build one tiny little unbound form... Well... It still ain't workin' yet. Now I like bound as much as anybody but there are just times when... Is anyone out there (on this list?) actually building database apps with this beastie? John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Sun Jan 8 10:24:14 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Sun, 8 Jan 2006 11:24:14 -0500 Subject: [dba-VB] Sensing email items in an outlook folder Message-ID: <001f01c6146f$f79acac0$8ad60e05@ColbyM6805> The following code was working in an Access project for sensing messages in a folder and processing the email. I am trying to build a little application for preparing my spam to be sent off to BlueFrog for reporting. The code is not working from directly inside of Outlook. The code gets here, but the Items collection never contains anything, even when there is email in the folder. Any ideas? Function CheckForSpamMail(fldrSpamIncoming As Outlook.MAPIFolder) As Boolean On Error GoTo Err_CheckForSpamMail Dim msg As Outlook.MailItem Debug.Print fldrSpamIncoming.Name For Each msg In fldrSpamIncoming.Items Debug.Print "CheckForSpamMail - Processing message #" & intMsgCnt; " of " & fldrSpamIncoming.Items.Count ProcessSpamMail fldrSpamIncoming, msg Next msg ' intMsgCntOrig = fldrSpamIncoming.Items.Count ' For intMsgCnt = 1 To intMsgCntOrig ' Set msg = fldrSpamIncoming.Items(1) ' Debug.Print "CheckForSpamMail - Processing message #" & intMsgCnt; " of " & fldrSpamIncoming.Items.Count ' ProcessSpamMail fldrSpamIncoming, msg ' Next intMsgCnt Exit_CheckForSpamMail: On Error Resume Next Set msg = Nothing Exit Function Err_CheckForSpamMail: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case -2147352567 'No messages Resume Exit_CheckForSpamMail Case Else '.All other errors will trap Beep MsgBox Err.Number & ":" & Err.Description, , "Error in Function dclsOutlook.CheckForSpamMail" Resume Exit_CheckForSpamMail End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com From DWUTKA at marlow.com Sun Jan 8 17:19:54 2006 From: DWUTKA at marlow.com (DWUTKA at marlow.com) Date: Sun, 8 Jan 2006 17:19:54 -0600 Subject: [dba-VB] Vb.net - all the recordsets Message-ID: <17724746D360394AA3BFE5B8D40A9C1BD4F4@main2.marlow.com> Nope, just VB6. Drew -----Original Message----- From: John Colby [SMTP:jwcolby at colbyconsulting.com] Sent: Sunday, January 08, 2006 9:59 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Vb.net - all the recordsets I'm wondering how experienced users of DotNet handle all the recordsets required for real database applications. In Access, you build a query and assign it to a property of a form or data aware control such as a list or combo. Access handles the details. In .Net, at least if you do it in code, you have to do a TON of stuff for each control - connection, command, data table etc. I haven't wrapped my mind around it yet so it probably seems bigger than it really is, but just trying to build one tiny little unbound form... Well... It still ain't workin' yet. Now I like bound as much as anybody but there are just times when... Is anyone out there (on this list?) actually building database apps with this beastie? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Mon Jan 9 07:25:42 2006 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Mon, 09 Jan 2006 08:25:42 -0500 Subject: [dba-VB] Vb.net - all the recordsets In-Reply-To: <000001c6146c$71a80ca0$8ad60e05@ColbyM6805> Message-ID: <002e01c61520$315f1710$2f01a8c0@dorismanning> I'm using the beastie to build database apps. I use mostly SQL DataAdapters, DataSets, and DataReaders. You need a DataAdapter for each query but you can stuff the results all in one DataSet. What I really like is the ability to bind the controls of a .Net form to a dataset. Everything is disconnected until I tell the changes to fire back. Feel free to contact me by IM if you need help. Doris Manning mikedorism at verizon.net From R.Griffiths at bury.gov.uk Tue Jan 10 03:27:02 2006 From: R.Griffiths at bury.gov.uk (Griffiths, Richard) Date: Tue, 10 Jan 2006 09:27:02 -0000 Subject: [dba-VB] Vb.net - all the recordsets Message-ID: <200601100915.k0A9Fjr14485@smarthost.yourcomms.net> Hi 'What I really like is the ability to bind the controls of a .Net form to a dataset.' and don't forget, even better IMO, binding to your business class objects allowing rich reusable classes to be built handling all the db updates. Richard -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mike & Doris Manning Sent: 09 January 2006 13:26 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Vb.net - all the recordsets I'm using the beastie to build database apps. I use mostly SQL DataAdapters, DataSets, and DataReaders. You need a DataAdapter for each query but you can stuff the results all in one DataSet. What I really like is the ability to bind the controls of a .Net form to a dataset. Everything is disconnected until I tell the changes to fire back. Feel free to contact me by IM if you need help. Doris Manning mikedorism at verizon.net _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Tue Jan 10 18:12:12 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 10 Jan 2006 19:12:12 -0500 Subject: [dba-VB] VB.Net combo Message-ID: <000501c61643$ac6d9340$647aa8c0@ColbyM6805> I'm trying to set up a combo in VB programmatically. The following is what I am using: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService") cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString cboService.ValueMember = Ds.Tables("cboService").Columns("RA_ID").ToString Return True End Function The function runs to cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString And fails with: "null reference exception was unhandled" I am trying to populate a combo box with two columns of a table, the PK column, and the "display" or text value column. What am I doing wrong? John W. Colby www.ColbyConsulting.com From ebarro at verizon.net Tue Jan 10 18:20:05 2006 From: ebarro at verizon.net (Eric Barro) Date: Tue, 10 Jan 2006 16:20:05 -0800 Subject: [dba-VB] VB.Net combo In-Reply-To: <000501c61643$ac6d9340$647aa8c0@ColbyM6805> Message-ID: <0ISW00BWEJLFA0B1@vms046.mailsrvcs.net> John, Shooting in the dark here because I do most of my development on web apps instead of win32 apps but the syntax should be the same. cboService.DataSource = Ds.Tables("cboService") Probably needs to read as... cboService.DataSource = Ds.Tables("cboService").DefaultView Eric -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Tuesday, January 10, 2006 4:12 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net combo I'm trying to set up a combo in VB programmatically. The following is what I am using: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService") cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString cboService.ValueMember = Ds.Tables("cboService").Columns("RA_ID").ToString Return True End Function The function runs to cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString And fails with: "null reference exception was unhandled" I am trying to populate a combo box with two columns of a table, the PK column, and the "display" or text value column. What am I doing wrong? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ NOD32 1.1359 (20060110) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From jwcolby at ColbyConsulting.com Tue Jan 10 20:34:52 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 10 Jan 2006 21:34:52 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <0ISW00BWEJLFA0B1@vms046.mailsrvcs.net> Message-ID: <000901c61657$9ab4e4f0$647aa8c0@ColbyM6805> Nope, didn't help (or hurt). Just no change. John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Tuesday, January 10, 2006 7:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net combo John, Shooting in the dark here because I do most of my development on web apps instead of win32 apps but the syntax should be the same. cboService.DataSource = Ds.Tables("cboService") Probably needs to read as... cboService.DataSource = Ds.Tables("cboService").DefaultView Eric -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Tuesday, January 10, 2006 4:12 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net combo I'm trying to set up a combo in VB programmatically. The following is what I am using: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService") cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString cboService.ValueMember = Ds.Tables("cboService").Columns("RA_ID").ToString Return True End Function The function runs to cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString And fails with: "null reference exception was unhandled" I am trying to populate a combo box with two columns of a table, the PK column, and the "display" or text value column. What am I doing wrong? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ NOD32 1.1359 (20060110) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Wed Jan 11 07:21:18 2006 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Wed, 11 Jan 2006 08:21:18 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <000501c61643$ac6d9340$647aa8c0@ColbyM6805> Message-ID: <000001c616b1$e9141df0$2f01a8c0@dorismanning> Don't ask where my brain was when we talked about this yesterday. It was obviously way too tired to think straight... The reference to the dataset is already known from the Datasource so all you need to do is directly tie the properties to the fields like this... cboService.DisplayMember = "RA_Rank" cboService.ValueMember = "RA_ID" Doris Manning mikedorism at verizon.net From jwcolby at ColbyConsulting.com Wed Jan 11 08:09:08 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Wed, 11 Jan 2006 09:09:08 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <000001c616b1$e9141df0$2f01a8c0@dorismanning> Message-ID: <001801c616b8$97164350$647aa8c0@ColbyM6805> We're making progress here. The code now is: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService").DefaultView cboService.DisplayMember = "SVC_Service" cboService.ValueMember = "SVC_ID" Return True End Function The combo displays the PK field however, not the Rank string. SVC_ID is the PK, so the value member is being displayed John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mike & Doris Manning Sent: Wednesday, January 11, 2006 8:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net combo Don't ask where my brain was when we talked about this yesterday. It was obviously way too tired to think straight... The reference to the dataset is already known from the Datasource so all you need to do is directly tie the properties to the fields like this... cboService.DisplayMember = "RA_Rank" cboService.ValueMember = "RA_ID" Doris Manning mikedorism at verizon.net _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Wed Jan 11 09:44:18 2006 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Wed, 11 Jan 2006 10:44:18 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <001801c616b8$97164350$647aa8c0@ColbyM6805> Message-ID: <000101c616c5$e3266330$2f01a8c0@dorismanning> Try... cboService.DataSource = Ds cboService.DataMember = "cboService" cboService.DisplayMember = "SVC_Service" cboService.ValueMember = "SVC_ID" Doris Manning mikedorism at verizon.net From listmaster at databaseadvisors.com Thu Jan 12 20:48:24 2006 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Thu, 12 Jan 2006 21:48:24 -0500 Subject: [dba-VB] Administrivia - DBA's New Executive Officers. Message-ID: <43C6CEA8.24082.46E416@listmaster.databaseadvisors.com> The Board of Directors of Database Advisors recently held elections for the executive committee for the upcoming year. The Executive Officers for 2006 are: President: John Bartow Vice-President: Reuben Cummings Secretary: Donna Cook Treasurer: Keith Williamson Congratulations to all. -- Bryan Carbonnell - listmaster at databaseadvisors.com Normal people worry me. From jwcolby at ColbyConsulting.com Sun Jan 1 19:17:31 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Sun, 1 Jan 2006 20:17:31 -0500 Subject: [dba-VB] VB.net 2005 data sources screwy Message-ID: <200601020117.k021HcV05226@databaseadvisors.com> I have used the Data Sources wizard to build data sources, but they don't display in the data sources window. If I build another, it tells me that the previous one exists, and if I do build another, it is not displayed either. Also, if I drop a data adapter into a form it does so, but immediately says that the data source doesn't exist. Has anyone seen / worked around behavior like this? John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ From jwcolby at ColbyConsulting.com Mon Jan 2 10:48:40 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Mon, 2 Jan 2006 11:48:40 -0500 Subject: [dba-VB] Free Visual Studio e-learning from Microsoft Message-ID: <000401c60fbc$63510440$647aa8c0@ColbyM6805> I just ran across this. http://msdn.microsoft.com/vstudio/learning/elearning_promo/default.aspx It is a limited time offer which expires very soon. One free course. I am examining it further now. John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ From JEHunnicutt at nhcl.med.navy.mil Tue Jan 3 09:33:25 2006 From: JEHunnicutt at nhcl.med.navy.mil (Hunnicutt, Jay E. (Cont)) Date: Tue, 3 Jan 2006 10:33:25 -0500 Subject: [dba-VB] VB.net 2005 data sources screwy Message-ID: <269A811DCC1DD540AC4AF58F59A169C50148A5BF@nh-clnc-exchng2.med.navy.mil> John, If I understand your problem correctly you need to open multiple data sources at the same time. We got around this by creating separate functions to open individual data sources. Their may be a better way but this has worked well for us. Dim cn As SqlConnection Dim cmd As SqlCommand Dim dr As SqlDataReader Dim cn2 As SqlConnection Dim cmd2 As SqlCommand Dim dr2 As SqlDataReader Dim cnmass As SqlConnection Dim cmdmass As SqlCommand Dim drmass As SqlDataReader Sub OpenConnection(strDB as String) If cn Is Nothing Then cn = New SqlConnection( "server=" & SQL_SERVER & ";uid=" & DB_User & ";password=" & DB_Password & ";database=" & strDB ) cn.Open() End If If Not dr Is Nothing Then If Not dr.IsClosed() Then dr.Close() End If End Sub Sub SQL_Select(strDB as String, SQL as String) OpenConnection(strDB) cmd = New SqlCommand( SQL, cn ) cmd.CommandTimeout = 300 dr = cmd.ExecuteReader() End Sub Sub OpenConnection2(strDB as String) If cn2 Is Nothing Then cn2 = New SqlConnection( "server=" & SQL_SERVER & ";uid=" & DB_User & ";password=" & DB_Password & ";database=" & strDB ) cn2.Open() End If If Not dr2 Is Nothing Then If Not dr2.IsClosed() Then dr2.Close() End If End Sub Sub SQL_Select2(strDB as String, SQL as String) OpenConnection2(strDB) cmd2 = New SqlCommand( SQL, cn2 ) cmd2.CommandTimeout = 180 dr2 = cmd2.ExecuteReader() End Sub Sub SQL_NonSelect(strDB as String, SQL as String) OpenConnection(strDB) cmd = New SqlCommand( SQL, cn ) cmd.ExecuteNonQuery() End Sub Sub SQL_NonSelect2(strDB as String, SQL as String) OpenConnection2(strDB) cmd2 = New SqlCommand( SQL, cn2 ) cmd2.ExecuteNonQuery() End Sub Sub CloseConnection() If Not dr Is Nothing Then If Not dr.IsClosed() Then dr.Close() End If cn.Close() cn = Nothing End Sub Sub CloseConnection2() If Not dr2 Is Nothing Then If Not dr2.IsClosed() Then dr2.Close() End If cn2.Close() cn2 = Nothing End Sub Hope this helps you. Jay Hunnicutt -----Original Message----- From: John Colby [mailto:jwcolby at ColbyConsulting.com] Sent: Sunday, January 01, 2006 8:18 PM To: VBA Subject: [dba-VB] VB.net 2005 data sources screwy I have used the Data Sources wizard to build data sources, but they don't display in the data sources window. If I build another, it tells me that the previous one exists, and if I do build another, it is not displayed either. Also, if I drop a data adapter into a form it does so, but immediately says that the data source doesn't exist. Has anyone seen / worked around behavior like this? John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Tue Jan 3 09:40:00 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 10:40:00 -0500 Subject: [dba-VB] VSS 2005 and VB Express 2005 Message-ID: <000901c6107b$f5c6b4e0$647aa8c0@ColbyM6805> Can they both be installed on the same machine at the same time? I have both installed and they both seem to work but I am having screwy problems with data wizards. John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Tue Jan 3 10:44:27 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 11:44:27 -0500 Subject: [dba-VB] Dot Net - messagebox Message-ID: <000e01c61084$f6ab5970$647aa8c0@ColbyM6805> In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Tue Jan 3 11:46:26 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 12:46:26 -0500 Subject: [dba-VB] VB.Net Application settings Message-ID: <001201c6108d$9f568b00$647aa8c0@ColbyM6805> Can the application settings be added programmatically? I have found how to add them manually, but I am not finding a My.Settings.Add or equivalent. These are very similar to my SysVars, though not quite as flexible, but my application needs to be able to add / save / update them at will in order to partially replace SysVars with Settings. John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Tue Jan 3 12:18:37 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 13:18:37 -0500 Subject: [dba-VB] Error using data controls Message-ID: <001601c61092$1e3f6aa0$647aa8c0@ColbyM6805> I am having huge problems using the toolbox to add a data grid to a form. I drag and drop the data grid on the form, and it opens a dialog box which allows me to select the data source. I select an existing source, and a specific table, and the wizard closes, but the error list now contains errors stating that the data source they the WIZARD OFFERED ME (and which does exist in the project) does not exist. If I click on the error I am taken to: Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container Me.DataGridView1 = New System.Windows.Forms.DataGridView Me.C2DbConquestDataSet1 = New C2DbConquest.C2DbConquestDataSet1 Me.TlkpServiceBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.TlkpServiceTableAdapter = New C2DbConquest.C2DbConquestDataSet1TableAdapters.tlkpServiceTableAdapter Where both the New C2DbConquest.C2DbConquestDataSet1 And the New C2DbConquest.C2DbConquestDataSet1TableAdapters.tlkpServiceTableAdapter Are squiggly underlined and claimed to not exist. I can't tell you how many hours I have wasted trying to get this thing to happen. Does anyone have a clue what is going on? John W. Colby www.ColbyConsulting.com From martyconnelly at shaw.ca Tue Jan 3 15:57:02 2006 From: martyconnelly at shaw.ca (MartyConnelly) Date: Tue, 03 Jan 2006 13:57:02 -0800 Subject: [dba-VB] Ado.net 2.0 References: <200512311637.jBVGbxV30372@databaseadvisors.com> Message-ID: <43BAF32E.9020405@shaw.ca> I am assuming you do not want to use the classes from the System.Data.SqlClient namespace, but ADO directly Writing Provider-Independent Data Access Code with ADO.NET 2.0 http://www.devx.com/dotnet/Article/27297 or Streamline your Data Connections by Moving to MARS http://www.devx.com/dbzone/Article/30132 Lots of other articles with code here on ADO.Net 2.0 John Colby wrote: >I am having a hard time getting started with ADO.net 2.0. I need example >code for SOMETHING (anything) that looks up data in a table, preferably in >an sql server db. > >As an example, I have a the "login form" that the wizard builds in VB.Net >2.0. It has two text boxes for username and password, and an OK and Cancel >button. No code. > >I have a user table in a SQL Server database, with a UserName and >PasswordHash field. > >I need to accept the user's input of the username and look it up in the user >table in the SQL, retrieving the passwordhash. > >I can do everything except get the data. Frustrating. I could do it in 1.x >(which still works) but I understand that there is a >"newer/better/faster/easier" way to do this stuff in 2.0. The only problem >is getting examples. As you probably know all anyone is interested in is >binding controls to data which isn't what I want. I need to know how to do >it all in code. > >Eventually (soon thereafter) I will want to pull an entire set of tables, >iterating the tables, populating classes with the data in the tables. The >data in the classes will be changing so I need the classes to be able to >write the data back out to the tables as well. Again, what I need in this >instance is an example, from the start, of dimming all of the objects >required, then reading data out of a given table, and writing data back into >that same table. > >If anyone has example code that they wrote, or a web page that does this >programmatic manipulation, from start to finish, I would be forever >grateful. > >John W. Colby >www.ColbyConsulting.com > >Contribute your unused CPU cycles to a good cause: >http://folding.stanford.edu/ > >_______________________________________________ >dba-VB mailing list >dba-VB at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-vb >http://www.databaseadvisors.com > > > > > -- Marty Connelly Victoria, B.C. Canada From michael at ddisolutions.com.au Tue Jan 3 16:58:43 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 4 Jan 2006 09:58:43 +1100 Subject: [dba-VB] Dot Net - messagebox Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116A192@ddi-01.DDI.local> Hi John, I've never used VB Express but... This is what I use... Dim result As DialogResult = MessageBox.Show _ ( _ "The application will be terminated...", _ "Application Fatal Error", _ MessageBoxButtons.OK, MessageBoxIcon.Stop, _ MessageBoxDefaultButton.Button1, _ MessageBoxOptions.DefaultDesktopOnly _ ) And it's a member of System.Windows.Forms so, Imports System HTH Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 3:44 AM To: VBA Subject: [dba-VB] Dot Net - messagebox In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Tue Jan 3 17:02:24 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 4 Jan 2006 10:02:24 +1100 Subject: [dba-VB] VB.Net Application settings Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116A193@ddi-01.DDI.local> John, Check out the MS Application blocks. It has a configuration component that you might find useful. If not you will be able to use the other components I guarantee. cheers Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 4:46 AM To: VBA Subject: [dba-VB] VB.Net Application settings Can the application settings be added programmatically? I have found how to add them manually, but I am not finding a My.Settings.Add or equivalent. These are very similar to my SysVars, though not quite as flexible, but my application needs to be able to add / save / update them at will in order to partially replace SysVars with Settings. John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Tue Jan 3 17:38:13 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 3 Jan 2006 18:38:13 -0500 Subject: [dba-VB] Dot Net - messagebox In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D0116A192@ddi-01.DDI.local> Message-ID: <004a01c610be$c42ef440$647aa8c0@ColbyM6805> I tried that and while I could import System, System.Windows was not available. I suspect that it is because this was not a "windows" project, but rather a "class library" project, but I am not sure of that. John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Tuesday, January 03, 2006 5:59 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Dot Net - messagebox Hi John, I've never used VB Express but... This is what I use... Dim result As DialogResult = MessageBox.Show _ ( _ "The application will be terminated...", _ "Application Fatal Error", _ MessageBoxButtons.OK, MessageBoxIcon.Stop, _ MessageBoxDefaultButton.Button1, _ MessageBoxOptions.DefaultDesktopOnly _ ) And it's a member of System.Windows.Forms so, Imports System HTH Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 3:44 AM To: VBA Subject: [dba-VB] Dot Net - messagebox In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Tue Jan 3 18:11:50 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 4 Jan 2006 11:11:50 +1100 Subject: [dba-VB] Dot Net - messagebox Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116A194@ddi-01.DDI.local> Ah, You need to add a reference to System.Windows.Forms.dll I assume the dll will have no interface components (forms etc), why not pass/raise any errors back to the calling function and let it raise the messageboxes if required? cheers Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 10:38 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Dot Net - messagebox I tried that and while I could import System, System.Windows was not available. I suspect that it is because this was not a "windows" project, but rather a "class library" project, but I am not sure of that. John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Tuesday, January 03, 2006 5:59 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Dot Net - messagebox Hi John, I've never used VB Express but... This is what I use... Dim result As DialogResult = MessageBox.Show _ ( _ "The application will be terminated...", _ "Application Fatal Error", _ MessageBoxButtons.OK, MessageBoxIcon.Stop, _ MessageBoxDefaultButton.Button1, _ MessageBoxOptions.DefaultDesktopOnly _ ) And it's a member of System.Windows.Forms so, Imports System HTH Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Wednesday, 4 January 2006 3:44 AM To: VBA Subject: [dba-VB] Dot Net - messagebox In a VB Express project, messagebox is valid, but when I open the same thing in the VS, it says it is not valid. Is it possibly because I created this project as a class library? I can't seem to import the forms namespace which IIRC is where the messagebox is contained. I am attempting to create my own library which I will reference from my projects. Should I not make it a class library or am I just completely off track? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Fri Jan 6 22:24:02 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Fri, 6 Jan 2006 23:24:02 -0500 Subject: [dba-VB] VB Express XML Comments Message-ID: <001501c61342$31b7b490$647aa8c0@ColbyM6805> I have discovered XML comments but don't see the way to turn on publishing them (outputting them at compile time). According to one book it is in the compile tab of the project but I don't find it. Does anyone know how to do this? John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Sun Jan 8 09:58:58 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Sun, 8 Jan 2006 10:58:58 -0500 Subject: [dba-VB] Vb.net - all the recordsets Message-ID: <000001c6146c$71a80ca0$8ad60e05@ColbyM6805> I'm wondering how experienced users of DotNet handle all the recordsets required for real database applications. In Access, you build a query and assign it to a property of a form or data aware control such as a list or combo. Access handles the details. In .Net, at least if you do it in code, you have to do a TON of stuff for each control - connection, command, data table etc. I haven't wrapped my mind around it yet so it probably seems bigger than it really is, but just trying to build one tiny little unbound form... Well... It still ain't workin' yet. Now I like bound as much as anybody but there are just times when... Is anyone out there (on this list?) actually building database apps with this beastie? John W. Colby www.ColbyConsulting.com From jwcolby at ColbyConsulting.com Sun Jan 8 10:24:14 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Sun, 8 Jan 2006 11:24:14 -0500 Subject: [dba-VB] Sensing email items in an outlook folder Message-ID: <001f01c6146f$f79acac0$8ad60e05@ColbyM6805> The following code was working in an Access project for sensing messages in a folder and processing the email. I am trying to build a little application for preparing my spam to be sent off to BlueFrog for reporting. The code is not working from directly inside of Outlook. The code gets here, but the Items collection never contains anything, even when there is email in the folder. Any ideas? Function CheckForSpamMail(fldrSpamIncoming As Outlook.MAPIFolder) As Boolean On Error GoTo Err_CheckForSpamMail Dim msg As Outlook.MailItem Debug.Print fldrSpamIncoming.Name For Each msg In fldrSpamIncoming.Items Debug.Print "CheckForSpamMail - Processing message #" & intMsgCnt; " of " & fldrSpamIncoming.Items.Count ProcessSpamMail fldrSpamIncoming, msg Next msg ' intMsgCntOrig = fldrSpamIncoming.Items.Count ' For intMsgCnt = 1 To intMsgCntOrig ' Set msg = fldrSpamIncoming.Items(1) ' Debug.Print "CheckForSpamMail - Processing message #" & intMsgCnt; " of " & fldrSpamIncoming.Items.Count ' ProcessSpamMail fldrSpamIncoming, msg ' Next intMsgCnt Exit_CheckForSpamMail: On Error Resume Next Set msg = Nothing Exit Function Err_CheckForSpamMail: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case -2147352567 'No messages Resume Exit_CheckForSpamMail Case Else '.All other errors will trap Beep MsgBox Err.Number & ":" & Err.Description, , "Error in Function dclsOutlook.CheckForSpamMail" Resume Exit_CheckForSpamMail End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com From DWUTKA at marlow.com Sun Jan 8 17:19:54 2006 From: DWUTKA at marlow.com (DWUTKA at marlow.com) Date: Sun, 8 Jan 2006 17:19:54 -0600 Subject: [dba-VB] Vb.net - all the recordsets Message-ID: <17724746D360394AA3BFE5B8D40A9C1BD4F4@main2.marlow.com> Nope, just VB6. Drew -----Original Message----- From: John Colby [SMTP:jwcolby at colbyconsulting.com] Sent: Sunday, January 08, 2006 9:59 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Vb.net - all the recordsets I'm wondering how experienced users of DotNet handle all the recordsets required for real database applications. In Access, you build a query and assign it to a property of a form or data aware control such as a list or combo. Access handles the details. In .Net, at least if you do it in code, you have to do a TON of stuff for each control - connection, command, data table etc. I haven't wrapped my mind around it yet so it probably seems bigger than it really is, but just trying to build one tiny little unbound form... Well... It still ain't workin' yet. Now I like bound as much as anybody but there are just times when... Is anyone out there (on this list?) actually building database apps with this beastie? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Mon Jan 9 07:25:42 2006 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Mon, 09 Jan 2006 08:25:42 -0500 Subject: [dba-VB] Vb.net - all the recordsets In-Reply-To: <000001c6146c$71a80ca0$8ad60e05@ColbyM6805> Message-ID: <002e01c61520$315f1710$2f01a8c0@dorismanning> I'm using the beastie to build database apps. I use mostly SQL DataAdapters, DataSets, and DataReaders. You need a DataAdapter for each query but you can stuff the results all in one DataSet. What I really like is the ability to bind the controls of a .Net form to a dataset. Everything is disconnected until I tell the changes to fire back. Feel free to contact me by IM if you need help. Doris Manning mikedorism at verizon.net From R.Griffiths at bury.gov.uk Tue Jan 10 03:27:02 2006 From: R.Griffiths at bury.gov.uk (Griffiths, Richard) Date: Tue, 10 Jan 2006 09:27:02 -0000 Subject: [dba-VB] Vb.net - all the recordsets Message-ID: <200601100915.k0A9Fjr14485@smarthost.yourcomms.net> Hi 'What I really like is the ability to bind the controls of a .Net form to a dataset.' and don't forget, even better IMO, binding to your business class objects allowing rich reusable classes to be built handling all the db updates. Richard -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mike & Doris Manning Sent: 09 January 2006 13:26 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Vb.net - all the recordsets I'm using the beastie to build database apps. I use mostly SQL DataAdapters, DataSets, and DataReaders. You need a DataAdapter for each query but you can stuff the results all in one DataSet. What I really like is the ability to bind the controls of a .Net form to a dataset. Everything is disconnected until I tell the changes to fire back. Feel free to contact me by IM if you need help. Doris Manning mikedorism at verizon.net _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at ColbyConsulting.com Tue Jan 10 18:12:12 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 10 Jan 2006 19:12:12 -0500 Subject: [dba-VB] VB.Net combo Message-ID: <000501c61643$ac6d9340$647aa8c0@ColbyM6805> I'm trying to set up a combo in VB programmatically. The following is what I am using: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService") cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString cboService.ValueMember = Ds.Tables("cboService").Columns("RA_ID").ToString Return True End Function The function runs to cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString And fails with: "null reference exception was unhandled" I am trying to populate a combo box with two columns of a table, the PK column, and the "display" or text value column. What am I doing wrong? John W. Colby www.ColbyConsulting.com From ebarro at verizon.net Tue Jan 10 18:20:05 2006 From: ebarro at verizon.net (Eric Barro) Date: Tue, 10 Jan 2006 16:20:05 -0800 Subject: [dba-VB] VB.Net combo In-Reply-To: <000501c61643$ac6d9340$647aa8c0@ColbyM6805> Message-ID: <0ISW00BWEJLFA0B1@vms046.mailsrvcs.net> John, Shooting in the dark here because I do most of my development on web apps instead of win32 apps but the syntax should be the same. cboService.DataSource = Ds.Tables("cboService") Probably needs to read as... cboService.DataSource = Ds.Tables("cboService").DefaultView Eric -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Tuesday, January 10, 2006 4:12 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net combo I'm trying to set up a combo in VB programmatically. The following is what I am using: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService") cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString cboService.ValueMember = Ds.Tables("cboService").Columns("RA_ID").ToString Return True End Function The function runs to cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString And fails with: "null reference exception was unhandled" I am trying to populate a combo box with two columns of a table, the PK column, and the "display" or text value column. What am I doing wrong? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ NOD32 1.1359 (20060110) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From jwcolby at ColbyConsulting.com Tue Jan 10 20:34:52 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Tue, 10 Jan 2006 21:34:52 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <0ISW00BWEJLFA0B1@vms046.mailsrvcs.net> Message-ID: <000901c61657$9ab4e4f0$647aa8c0@ColbyM6805> Nope, didn't help (or hurt). Just no change. John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Tuesday, January 10, 2006 7:20 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net combo John, Shooting in the dark here because I do most of my development on web apps instead of win32 apps but the syntax should be the same. cboService.DataSource = Ds.Tables("cboService") Probably needs to read as... cboService.DataSource = Ds.Tables("cboService").DefaultView Eric -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Tuesday, January 10, 2006 4:12 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VB.Net combo I'm trying to set up a combo in VB programmatically. The following is what I am using: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService") cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString cboService.ValueMember = Ds.Tables("cboService").Columns("RA_ID").ToString Return True End Function The function runs to cboService.DisplayMember = Ds.Tables("cboService").Columns("RA_Rank").ToString And fails with: "null reference exception was unhandled" I am trying to populate a combo box with two columns of a table, the PK column, and the "display" or text value column. What am I doing wrong? John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ NOD32 1.1359 (20060110) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Wed Jan 11 07:21:18 2006 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Wed, 11 Jan 2006 08:21:18 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <000501c61643$ac6d9340$647aa8c0@ColbyM6805> Message-ID: <000001c616b1$e9141df0$2f01a8c0@dorismanning> Don't ask where my brain was when we talked about this yesterday. It was obviously way too tired to think straight... The reference to the dataset is already known from the Datasource so all you need to do is directly tie the properties to the fields like this... cboService.DisplayMember = "RA_Rank" cboService.ValueMember = "RA_ID" Doris Manning mikedorism at verizon.net From jwcolby at ColbyConsulting.com Wed Jan 11 08:09:08 2006 From: jwcolby at ColbyConsulting.com (John Colby) Date: Wed, 11 Jan 2006 09:09:08 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <000001c616b1$e9141df0$2f01a8c0@dorismanning> Message-ID: <001801c616b8$97164350$647aa8c0@ColbyM6805> We're making progress here. The code now is: Function LoadCboService() Dim strCnn As String = My.Settings.C2DbConquestConnectionString Dim cnn As New SqlConnection(strCnn) cnn.Open() Dim strSQLService As String = "SELECT * FROM tlkpService" Dim cmd As New SqlCommand(strSQLService, cnn) Dim adpt As New SqlDataAdapter(cmd) Dim Ds As DataSet Ds = New DataSet("cboService") adpt.Fill(Ds, "cboService") cboService.DataSource = Ds.Tables("cboService").DefaultView cboService.DisplayMember = "SVC_Service" cboService.ValueMember = "SVC_ID" Return True End Function The combo displays the PK field however, not the Rank string. SVC_ID is the PK, so the value member is being displayed John W. Colby www.ColbyConsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mike & Doris Manning Sent: Wednesday, January 11, 2006 8:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VB.Net combo Don't ask where my brain was when we talked about this yesterday. It was obviously way too tired to think straight... The reference to the dataset is already known from the Datasource so all you need to do is directly tie the properties to the fields like this... cboService.DisplayMember = "RA_Rank" cboService.ValueMember = "RA_ID" Doris Manning mikedorism at verizon.net _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mikedorism at verizon.net Wed Jan 11 09:44:18 2006 From: mikedorism at verizon.net (Mike & Doris Manning) Date: Wed, 11 Jan 2006 10:44:18 -0500 Subject: [dba-VB] VB.Net combo In-Reply-To: <001801c616b8$97164350$647aa8c0@ColbyM6805> Message-ID: <000101c616c5$e3266330$2f01a8c0@dorismanning> Try... cboService.DataSource = Ds cboService.DataMember = "cboService" cboService.DisplayMember = "SVC_Service" cboService.ValueMember = "SVC_ID" Doris Manning mikedorism at verizon.net From listmaster at databaseadvisors.com Thu Jan 12 20:48:24 2006 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Thu, 12 Jan 2006 21:48:24 -0500 Subject: [dba-VB] Administrivia - DBA's New Executive Officers. Message-ID: <43C6CEA8.24082.46E416@listmaster.databaseadvisors.com> The Board of Directors of Database Advisors recently held elections for the executive committee for the upcoming year. The Executive Officers for 2006 are: President: John Bartow Vice-President: Reuben Cummings Secretary: Donna Cook Treasurer: Keith Williamson Congratulations to all. -- Bryan Carbonnell - listmaster at databaseadvisors.com Normal people worry me.