|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Binding combo boxcoming from an SQL database table when my form loads. After the form loads nothing is populated in the combo box that supposed to be bound to a column in the database table. Someone in this newsgroup thankfully told that I still have to write some codes to populate the combo box with data. Here is the code he sent me and that I tried on my application. The codes return the following error message: "Unhandled Exception: System.Data.OleDb.OleDbException: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done". Can someone please tell me how to make this code work? Dim strConn As String Dim strSQL As String Dim SscIntake1 As New DataSet() Dim da As OleDb.OleDbDataAdapter Dim conn As OleDb.OleDbConnection strConn = "Provider = Microsoft.Jet.OLEDB.4.0;" strConn &= "Data Source = Persist Security Info=true;Integrated Security=false;User ID=sa;Password=xxx;database=SSC;server=zzz;" conn = New OleDb.OleDbConnection(strConn) da = New OleDb.OleDbDataAdapter("Select * From qmf_cint", conn) da.Fill(SscIntake1, "qmf_cint") ComboBox1.DataSource = SscIntake1.Tables("qmf_cint") ComboBox1.DisplayMember = "Last_Name" -- TS Hi,
Your connection string is wrong strConn &= "Data Source = Persist Security Info=true;Integrated Security=false;User ID=sa;Password=xxx;database=SSC;server=zzz;" Here is an example strConn = "Provider = Microsoft.Jet.OLEDB.4.0;" strConn &= "Data Source = C:\Northwind.mdb;" Ken ------------------------- "TS" <T*@discussions.microsoft.com> wrote in message I configured a data adapter and generated a dataset to access datanews:CEA16F67-E2B6-4780-9F01-B6BBA9B78EA0@microsoft.com... coming from an SQL database table when my form loads. After the form loads nothing is populated in the combo box that supposed to be bound to a column in the database table. Someone in this newsgroup thankfully told that I still have to write some codes to populate the combo box with data. Here is the code he sent me and that I tried on my application. The codes return the following error message: "Unhandled Exception: System.Data.OleDb.OleDbException: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done". Can someone please tell me how to make this code work? Dim strConn As String Dim strSQL As String Dim SscIntake1 As New DataSet() Dim da As OleDb.OleDbDataAdapter Dim conn As OleDb.OleDbConnection strConn = "Provider = Microsoft.Jet.OLEDB.4.0;" strConn &= "Data Source = Persist Security Info=true;Integrated Security=false;User ID=sa;Password=xxx;database=SSC;server=zzz;" conn = New OleDb.OleDbConnection(strConn) da = New OleDb.OleDbDataAdapter("Select * From qmf_cint", conn) da.Fill(SscIntake1, "qmf_cint") ComboBox1.DataSource = SscIntake1.Tables("qmf_cint") ComboBox1.DisplayMember = "Last_Name" -- TS Thanks, but I'm getting confused now. The server where the SQL database
resides is USEGNYDC3\CLIENT_DB and the database name is SSC. I tried the following connection string: strConn &= "Data Source = \\USEGNYDC3\CLIENT_DB\SSC.mdb;" and got an error message. What should the connection string be then? Show quoteHide quote "Ken Tucker [MVP]" wrote: > Hi, > > Your connection string is wrong > > strConn &= "Data Source = Persist Security Info=true;Integrated > Security=false;User ID=sa;Password=xxx;database=SSC;server=zzz;" > > > Here is an example > strConn = "Provider = Microsoft.Jet.OLEDB.4.0;" > > strConn &= "Data Source = C:\Northwind.mdb;" > > > > Ken > > ------------------------- > > "TS" <T*@discussions.microsoft.com> wrote in message > news:CEA16F67-E2B6-4780-9F01-B6BBA9B78EA0@microsoft.com... > I configured a data adapter and generated a dataset to access data > coming from an SQL database table when my form loads. After the form loads > nothing is populated in the combo box that supposed to be bound to a column > in the database table. Someone in this newsgroup thankfully told that I > still > have to write some codes to populate the combo box with data. Here is the > code he sent me and that I tried on my application. The codes return the > following error message: "Unhandled Exception: > System.Data.OleDb.OleDbException: Multiple-step OLE DB operation generated > errors. Check each OLE DB status value, if available. No work was done". Can > someone please tell me how to make this code work? > > Dim strConn As String > > Dim strSQL As String > > Dim SscIntake1 As New DataSet() > > Dim da As OleDb.OleDbDataAdapter > > Dim conn As OleDb.OleDbConnection > > strConn = "Provider = Microsoft.Jet.OLEDB.4.0;" > strConn &= "Data Source = Persist Security Info=true;Integrated > Security=false;User ID=sa;Password=xxx;database=SSC;server=zzz;" > > conn = New OleDb.OleDbConnection(strConn) > > da = New OleDb.OleDbDataAdapter("Select * From qmf_cint", conn) > > da.Fill(SscIntake1, "qmf_cint") > > ComboBox1.DataSource = SscIntake1.Tables("qmf_cint") > > ComboBox1.DisplayMember = "Last_Name" > > > -- > TS > > >
2D array of string
Equivalent to Mid function but read from right of the string Opening a browser from vb.net from Help using Right() string function? need clarification from M S Herfried K. Wagner 2GB memory limit Bitmap and MemoryStream Command Line Compiling with license file How to set the default value of a date picker to nothing (blank) DateTimePicker |
|||||||||||||||||||||||