
elf
Avatar/Signature-
Posts
38 -
Joined
-
Last visited
elf's Achievements
Newbie (1/14)
0
Reputation
-
hi guys... i encounter a problem with my datagrid.. i have to refresh my browser in order for it to show my updated info.. is there any way there i can sovle this... thanks ppl....
-
i was trying to update information to my database with datagrid using vb.net..i run the program and it runs BUT the bad thing is that although it runs...the information is not being updated...the worse thing is that becoz it doesn't show any error so i dun knoe wat to do??? Can anyone help mi??? The source code i use is below: SOURCE CODE ------------------------------------------------------------------------------------ Dim conn As System.Data.OleDb.OleDbConnection Dim MyCommand As System.Data.OleDb.OleDbCommand Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";Data Source=C:\Inetpub" & _ "\wwwroot\tempdb.mdb;Mode=ReadWrite|Share Deny Dim txtTS1 As TextBox = e.Item.Cells(6).Controls(0) Dim txtTS2 As TextBox = e.Item.Cells(7).Controls(0) Dim txtTS3 As TextBox = e.Item.Cells(8).Controls(0) Dim txtTS4 As TextBox = e.Item.Cells(9).Controls(0) Dim txtTS5 As TextBox = e.Item.Cells(10).Controls(0) Dim txtTS6 As TextBox = e.Item.Cells(11).Controls(0) Dim txtTS7 As TextBox = e.Item.Cells(12).Controls(0) Dim txtTS8 As TextBox = e.Item.Cells(13).Controls(0) Dim strUpdateStmt As String strUpdateStmt = " UPDATE Timetable SET" & " TS1 =@C1, TS2 =@C2, TS3 = @C3 ,TS4 =@C4, TS5 =@C5 ,TS6 =@C6, TS7 =@C7, TS8 =@C8, TS9 =@C9 ,TS10 =@C10" conn = New System.Data.OleDb.OleDbConnection(strConn) MyCommand = New System.Data.OleDb.OleDbCommand(strUpdateStmt, conn) MyCommand.Parameters.Add(New OleDb.OleDbParameter("@C1", txtTS1.Text)) MyCommand.Parameters.Add(New OleDb.OleDbParameter("@C2", txtTS2.Text)) MyCommand.Parameters.Add(New OleDb.OleDbParameter("@C3", txtTS3.Text)) MyCommand.Parameters.Add(New OleDb.OleDbParameter("@C4", txtTS4.Text)) MyCommand.Parameters.Add(New OleDb.OleDbParameter("@C5", txtTS5.Text)) MyCommand.Parameters.Add(New OleDb.OleDbParameter("@C6", txtTS6.Text)) MyCommand.Parameters.Add(New OleDb.OleDbParameter("@C7", txtTS7.Text)) MyCommand.Parameters.Add(New OleDb.OleDbParameter("@C8", txtTS8.Text)) MyCommand.Parameters.Add(New OleDb.OleDbParameter("@ID", e.Item.Cells(1).Text)) conn.Open() MyCommand.ExecuteNonQuery() DataGrid1.EditItemIndex = -1 conn.Close() BindData() End Sub Sub BindData() Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";Data Source=C:\Inetpub" & _ "\wwwroot\tempdb.mdb;Mode=ReadWrite|Share Deny Dim oledb As String = "Select id, TS1, TS2, TS3, TS4, TS5, TS6, TS7, TS8, TS9 from Timetable" Dim conn As New System.Data.OleDb.OleDbConnection(strConn) Dim objDR As OleDb.OleDbDataReader Dim Cmd As New System.Data.OleDb.OleDbCommand(oledb, conn) conn.Open() objDR = Cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection) DataGrid1.DataSource = objDR DataGrid1.DataBind() conn.Close() End Sub
-
i am now using a datagrid to display my data from my database... but i wanna user to be able to edit , update and cancel the information.. how should i go bout doing it...can somebody guides mi... the code i have for edit and cancel are below...can anyone tells mi whether it'e rite anot...and if it's rite how should i go bout doing the update part...i have visited many sites but i dun understan....thanks Source Code ------------------------------------------------------------------------------------ Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load OleDbDataAdapter1.Fill(DataSet41) DataGrid1.DataBind() 'Put user code to initialize the page here End Sub Sub DataGrid1_Edit(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) DataGrid1.EditItemIndex = e.Item.ItemIndex OleDbDataAdapter1.Fill(DataSet41) DataGrid1.DataBind() End Sub Sub DataGrid1_Cancel(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) DataGrid1.EditItemIndex = -1 OleDbDataAdapter1.Fill(DataSet41) DataGrid1.DataBind() End Sub
-
Help... i try to bind my data to my datalist and i have got a stupid error that say 'DATA MISMATCH' does anyone knoes wat the stupid error was....the suorce code i use.. MY SOURCE CODE... <%# DataBinder.Eval(Container.DataItem, "Day") %> <br> <%# DataBinder.Eval(Container.DataItem, "Date") %> and <%# DataBinder.Eval(Container.DataItem, "TS1") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS2") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS3") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS4") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS5") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS6") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS7") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS8") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS9") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS10") %>
-
Help... i try to bind my data to my datalist and i have got a stupid error that say 'DATA MISMATCH' does anyone knoes wat the stupid error was....the suorce code i use was and my data base is in the attach file..... MY SOURCE CODE... <%# DataBinder.Eval(Container.DataItem, "Day") %> <br> <%# DataBinder.Eval(Container.DataItem, "Date") %> and <%# DataBinder.Eval(Container.DataItem, "TS1") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS2") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS3") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS4") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS5") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS6") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS7") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS8") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS9") %> <br> <%# DataBinder.Eval(Container.DataItem, "TS10") %>
-
Can anyone tells mi how to insert, and update a record using a datalist into my access database.... Need Help Urgently.....thanks for any kindhearted that offer a helping hand....
-
can anyone tell mi how do i insert data in datalist... the database i am using is an Access Data Base... a millon thanks in advance....
-
Does anyone knoes how to update information in the Datelist???
-
thanks for the advice...i use the vbCrlf and it works...
-
Does anyone knoe wat is the command for next line in vb.net.. any help given is greatly appreciated....
-
Does anyone knoe how to establish sql connections.. coz i need to verify my login entry with the data base b4 allowing user to login... Any help given is very much appreciated....
-
thanks for the advices... it works
-
Can anyone helps mi with this.. i have create a login page using authentication... i am now able to login to the others page by logining in 1st... otherwise if not login it will redirect mi to the login page... BUT when i logout, i am still able to view the other page by typing the url in browser.. the command i use was FormsAuthentication.SignOut().. but it doesn't work... Help!!!!
-
i'm veri sorri i can't click on yur link.. is there any other links u recomend??
-
Does anyone knoes how to create a authentication in web config.. any help provided is appreciated...