DataSet fill and bindings to textbox

a02227

Member
Joined
Nov 30, 2004
Messages
15
Location
Ireland
Programming Experience
Beginner
I am having a problem fill the dataset that i created, I have done this in VB.net windows forms but never on web apps. Can anyone give me a bit of guidance of were to go now? I have the textboxs bound to the dataset (I think) and there is a connection to the database and a dataset has been generated of the table i want to use but i'm lost as to how it should be filled????? heres the code i have so far: -

Me.OleDbDataAdapter1 = New System.Data.OleDb.OleDbDataAdapter
Me.OleDbConnection1 = New System.Data.OleDb.OleDbConnection
Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbInsertCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbUpdateCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbDeleteCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbConnection2 = New System.Data.OleDb.OleDbConnection
Me.DsMembers1 = New WebApplication1.DSMembers
CType(Me.DsMembers1, System.ComponentModel.ISupportInitialize).BeginInit()
'
'OleDbDataAdapter1
'
Me.OleDbDataAdapter1.DeleteCommand = Me.OleDbDeleteCommand1
Me.OleDbDataAdapter1.InsertCommand = Me.OleDbInsertCommand1
Me.OleDbDataAdapter1.SelectCommand = Me.OleDbSelectCommand1
Me.OleDbDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "Members", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("Credit Card Details", "Credit Card Details"), New System.Data.Common.DataColumnMapping("Date of Birth", "Date of Birth"), New System.Data.Common.DataColumnMapping("Date of Last Test", "Date of Last Test"), New System.Data.Common.DataColumnMapping("First Name", "First Name"), New System.Data.Common.DataColumnMapping("Membership No", "Membership No"), New System.Data.Common.DataColumnMapping("Photograph", "Photograph"), New System.Data.Common.DataColumnMapping("Surname", "Surname"), New System.Data.Common.DataColumnMapping("Test Result", "Test Result")})})
Me.OleDbDataAdapter1.UpdateCommand = Me.OleDbUpdateCommand1
'
'OleDbSelectCommand1
'
Me.OleDbSelectCommand1.CommandText = "SELECT [Credit Card Details], [Date of Birth], [Date of Last Test], [First Name]," & _
" [Membership No], Photograph, Surname, [Test Result] FROM Members"
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection2
'
'OleDbInsertCommand1
'
Me.OleDbInsertCommand1.CommandText = "INSERT INTO Members([Credit Card Details], [Date of Birth], [Date of Last Test], " & _
"[First Name], Photograph, Surname, [Test Result]) VALUES (?, ?, ?, ?, ?, ?, ?)"
Me.OleDbInsertCommand1.Connection = Me.OleDbConnection2
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Credit_Card_Details", System.Data.OleDb.OleDbType.VarWChar, 12, "Credit Card Details"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Date_of_Birth", System.Data.OleDb.OleDbType.DBDate, 0, "Date of Birth"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Date_of_Last_Test", System.Data.OleDb.OleDbType.DBDate, 0, "Date of Last Test"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("First_Name", System.Data.OleDb.OleDbType.VarWChar, 50, "First Name"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Photograph", System.Data.OleDb.OleDbType.VarBinary, 0, "Photograph"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Surname", System.Data.OleDb.OleDbType.VarWChar, 50, "Surname"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Test_Result", System.Data.OleDb.OleDbType.Boolean, 2, "Test Result"))
'
'OleDbUpdateCommand1
'
Me.OleDbUpdateCommand1.CommandText = "UPDATE Members SET [Credit Card Details] = ?, [Date of Birth] = ?, [Date of Last " & _
"Test] = ?, [First Name] = ?, Photograph = ?, Surname = ?, [Test Result] = ? WHER" & _
"E ([Membership No] = ?) AND ([Credit Card Details] = ? OR ? IS NULL AND [Credit " & _
"Card Details] IS NULL) AND ([Date of Birth] = ? OR ? IS NULL AND [Date of Birth]" & _
" IS NULL) AND ([Date of Last Test] = ? OR ? IS NULL AND [Date of Last Test] IS N" & _
"ULL) AND ([First Name] = ? OR ? IS NULL AND [First Name] IS NULL) AND (Surname =" & _
" ? OR ? IS NULL AND Surname IS NULL) AND ([Test Result] = ?)"
Me.OleDbUpdateCommand1.Connection = Me.OleDbConnection2
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Credit_Card_Details", System.Data.OleDb.OleDbType.VarWChar, 12, "Credit Card Details"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Date_of_Birth", System.Data.OleDb.OleDbType.DBDate, 0, "Date of Birth"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Date_of_Last_Test", System.Data.OleDb.OleDbType.DBDate, 0, "Date of Last Test"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("First_Name", System.Data.OleDb.OleDbType.VarWChar, 50, "First Name"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Photograph", System.Data.OleDb.OleDbType.VarBinary, 0, "Photograph"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Surname", System.Data.OleDb.OleDbType.VarWChar, 50, "Surname"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Test_Result", System.Data.OleDb.OleDbType.Boolean, 2, "Test Result"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Membership_No", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Membership No", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Credit_Card_Details", System.Data.OleDb.OleDbType.VarWChar, 12, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Credit Card Details", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Credit_Card_Details1", System.Data.OleDb.OleDbType.VarWChar, 12, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Credit Card Details", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Date_of_Birth", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Date of Birth", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Date_of_Birth1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Date of Birth", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Date_of_Last_Test", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Date of Last Test", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Date_of_Last_Test1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Date of Last Test", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_First_Name", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "First Name", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_First_Name1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "First Name", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Surname", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Surname", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Surname1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Surname", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Test_Result", System.Data.OleDb.OleDbType.Boolean, 2, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Test Result", System.Data.DataRowVersion.Original, Nothing))
'
'OleDbDeleteCommand1
'
Me.OleDbDeleteCommand1.CommandText = "DELETE FROM Members WHERE ([Membership No] = ?) AND ([Credit Card Details] = ? OR" & _
" ? IS NULL AND [Credit Card Details] IS NULL) AND ([Date of Birth] = ? OR ? IS N" & _
"ULL AND [Date of Birth] IS NULL) AND ([Date of Last Test] = ? OR ? IS NULL AND [" & _
"Date of Last Test] IS NULL) AND ([First Name] = ? OR ? IS NULL AND [First Name] " & _
"IS NULL) AND (Surname = ? OR ? IS NULL AND Surname IS NULL) AND ([Test Result] =" & _
" ?)"
Me.OleDbDeleteCommand1.Connection = Me.OleDbConnection2
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Membership_No", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Membership No", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Credit_Card_Details", System.Data.OleDb.OleDbType.VarWChar, 12, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Credit Card Details", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Credit_Card_Details1", System.Data.OleDb.OleDbType.VarWChar, 12, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Credit Card Details", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Date_of_Birth", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Date of Birth", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Date_of_Birth1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Date of Birth", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Date_of_Last_Test", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Date of Last Test", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Date_of_Last_Test1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Date of Last Test", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_First_Name", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "First Name", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_First_Name1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "First Name", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Surname", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Surname", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Surname1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Surname", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Test_Result", System.Data.OleDb.OleDbType.Boolean, 2, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Test Result", System.Data.DataRowVersion.Original, Nothing))
'
'OleDbConnection2
'
Me.OleDbConnection2.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Data Source=""C:\Documents and Settings\Admin\Desktop\ClearClub.mdb" & _
""";Jet OLEDB:Engine Type=5;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:System da" & _
"tabase=;Jet OLEDB:SFP=False;persist security info=False;Extended Properties=;Mod" & _
"e=Share Deny None;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Create System Datab" & _
"ase=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without" & _
" Replica Repair=False;User ID=Admin;Jet OLEDB:Global Bulk Transactions=1"
'
'DsMembers1
'
Me.DsMembers1.DataSetName = "DSMembers"
Me.DsMembers1.Locale = New System.Globalization.CultureInfo("en-GB")
CType(Me.DsMembers1, System.ComponentModel.ISupportInitialize).EndInit()
 
Back
Top