elearnindia
New member
- Joined
- Mar 3, 2010
- Messages
- 4
- Programming Experience
- 1-3
How to store time from DTPicker in SQLServer 2000 when the front end is in VB2005.I am using the following code:-
In the add form:-
GetNewAuthor() Function is in DataAcces DLL:-
Save uses the following code:-
Time is not getting stored in SQLServer2000 database.Any kind help will be appreciated
In the add form:-
VB.NET:
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Dim dsNewCustomer As DataSet = DataAccess.AuthorData.DataModule.GetNewAuthor
Dim frm As New frmAuthor
frm.MainForm = Me
frm.LoadData(dsNewCustomer)
frm.txtAuthorid.ReadOnly = False
frm.ShowDialog()
End Sub
GetNewAuthor() Function is in DataAcces DLL:-
VB.NET:
Public Function GetNewAuthor() As DataSet
Dim conn As SqlConnection = Me.GetConnection()
Try
Dim strSQL As String = "Select * from newauthor where au_id = ''"
Dim da As SqlDataAdapter = New SqlDataAdapter(strSQL, conn)
Dim ds As New DataSet
Try
da.Fill(ds, "newauthor")
Dim dr As DataRow = ds.Tables(0).NewRow
ds.Tables(0).Rows.Add(dr)
Finally
da.Dispose()
End Try
Return ds
Finally
conn.Close()
conn.Dispose()
End Try
End Function
Save uses the following code:-
VB.NET:
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
BindingContext(dsAuthor, "newauthor").EndCurrentEdit()
DataAccess.AuthorData.DataModule.SaveAuthor(dsAuthor)
MainForm.LoadData()
Me.Close()
End Sub
Time is not getting stored in SQLServer2000 database.Any kind help will be appreciated