Jump to content
Xtreme .Net Talk

elf

Avatar/Signature
  • Posts

    38
  • Joined

  • Last visited

Everything posted by elf

  1. 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....
  2. 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
  3. 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
  4. 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") %>
  5. 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") %>
  6. 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....
  7. elf

    Insert????

    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....
  8. Does anyone knoes how to update information in the Datelist???
  9. elf

    Help Needed!!!

    thanks for the advice...i use the vbCrlf and it works...
  10. Does anyone knoe wat is the command for next line in vb.net.. any help given is greatly appreciated....
  11. 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....
  12. thanks for the advices... it works
  13. 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!!!!
  14. i'm veri sorri i can't click on yur link.. is there any other links u recomend??
  15. Does anyone knoes how to create a authentication in web config.. any help provided is appreciated...
  16. Does anyone knoes how to block the back button of the browser using asp.net or any other ways..thanks 4 any help provided..
  17. elf

    Regarding cookies

    oh i see.. so meaning that cookies isn't necessary..thanks
  18. elf

    Regarding cookies

    i have try already but there seems to be n changes.. i created a cookies and then check for it in the other page..it does link but erm wat i wans is that all user have to login b4 they can access to the other page..i dun wan them to like skip the login page and access to the other page of my applications..
  19. elf

    Regarding cookies

    thanks for the help..but i wans the page the check for the cookies..if not found then redirect it back to the page i wans..how do i do it..i try to use response.redirect but nothing happens...how?
  20. Does anyone knows how to create and read cookies using vb.net.Thanks 4 any help provided...:D
  21. Thanks for the help given
  22. does anyone knoes how to define SqlDataReader coz when i try to define it in my vb.net it kept giving mi the error that sqldatareader is not define??? is it something like that Dim dr As sqlDataReader???? thanks 4 any help provided!!!
  23. Dropdownlist???? Does abyone knoes how to display the things u chose from the drop down list??? for example i have a dropdownlist which contained time and then i chose a time that i want but how to display it by using a label???
  24. where should i place the code in html or aspx.vb??? coz when i place it in aspx.vb there is an error know as fomat not declared..but when i put in the html file nothings happened???
  25. i'm sorry..din phrase my question properly i am now using visual studio .net and vb.net for this application...
×
×
  • Create New...