473,698 Members | 2,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.NET -Web App: Problems Updating Datagrid

23 New Member
hi all..
I am trying to update my datagrid in my webform...but its not getting updated..though in the database it removing the <null> and inserting a blank field....its not taking the input which m typing...can sombody plz help me out in this..i need help urgently
I am posting the code in vb.net for the webform as well as html
Expand|Select|Wrap|Line Numbers
  1. Protected Sub DataGrid1_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.UpdateCommand
  2.         Dim Stocksent1 As TextBox = CType(e.Item.FindControl("TextBox2"), TextBox)
  3.         Dim Signed1 As TextBox = CType(e.Item.FindControl("SignedTextBox"), TextBox)
  4.         Dim Items1 As String = DataGrid1.DataKeys(e.Item.ItemIndex).ToString()
  5.         Dim myConnection As New SqlConnection("Server=SERVER;uid=sa;pwd=;Database=Central")
  6.         myConnection.Open()
  7.  
  8.         myCommand1 = New SqlCommand("Update Table3 set Stocksent='" & Stocksent1.Text & "', Signedby='" & Signed1.Text & "' , Flag=0, Sentdate=getdate() where Items='" & Items1 & "' ", myConnection)
  9.         'myCommand1.Parameters.Add("@Items", SqlDbType.NVarChar).Value = Items
  10.         'myCommand1.Parameters.Add("@Stocksent1", SqlDbType.NVarChar).Value = Stocksent1.Text
  11.         'myCommand1.Parameters.Add("@Signedby1", SqlDbType.NVarChar).Value = Signed1.Text
  12.         ra = myCommand1.ExecuteNonQuery()
  13.         myConnection.Close()
  14.         Response.Write("Records Updated")
  15.         DataGrid1.EditItemIndex = -1
  16.         DataGrid1.DataBind()
  17.         DataGrid1.Columns(8).Visible = False
  18.         DataGrid1.Columns(9).Visible = False
  19.         DataGrid1.Columns(10).Visible = False
  20.         DataGrid1.Columns(11).Visible = False
  21.         DataGrid1.Columns(12).Visible = False
  22.  
  23.     End Sub
  24.  
HTML CODE
Expand|Select|Wrap|Line Numbers
  1. <form id="Form1" method="post" runat="server">
  2.             <asp:datagrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 64px; POSITION: absolute; TOP: 296px"
  3.                 runat="server" AutoGenerateColumns="False" DataKeyField="Items" Width="848px" ForeColor="DimGray"
  4.                 BackColor="Wheat" BorderColor="#660033" Height="72px">
  5.                 <HeaderStyle Font-Bold="True" ForeColor="Chocolate" BackColor="LightGray"></HeaderStyle>
  6.                 <Columns>
  7.                     <asp:BoundColumn DataField="Lognumm" ReadOnly="True" HeaderText="Lognumm"></asp:BoundColumn>
  8.                     <asp:BoundColumn DataField="Requestdate" ReadOnly="True" HeaderText="Requestdate"></asp:BoundColumn>
  9.                     <asp:BoundColumn DataField="Hospital" ReadOnly="True" HeaderText="Hospital"></asp:BoundColumn>
  10.                     <asp:BoundColumn DataField="Items" ReadOnly="True" HeaderText="Items"></asp:BoundColumn>
  11.                     <asp:BoundColumn DataField="Currentstock" ReadOnly="True" HeaderText="Currentstock"></asp:BoundColumn>
  12.                     <asp:BoundColumn DataField="Stockrequest" ReadOnly="True" HeaderText="Stockrequest"></asp:BoundColumn>
  13.                     <asp:BoundColumn DataField="Priority" ReadOnly="True" HeaderText="Priority"></asp:BoundColumn>
  14.                     <asp:BoundColumn DataField="Comment" ReadOnly="True" HeaderText="Comment"></asp:BoundColumn>
  15.                     <asp:TemplateColumn Visible="False" HeaderText="Stocksent">
  16.                         <ItemTemplate>
  17.                             <asp:Label id=Label2 runat="server" Text='<%# DataBinder.Eval (Container.DataItem , "Stocksent") %>'>
  18.                             </asp:Label>
  19.                         </ItemTemplate>
  20.                         <EditItemTemplate>
  21.                             <asp:TextBox id=TextBox2 runat="server" Text='<%# DataBinder.Eval(Container.DataItem , "Stocksent") %>'>
  22.                             </asp:TextBox>
  23.                             <asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ErrorMessage="Enter value" ControlToValidate="TextBox2"></asp:RequiredFieldValidator>
  24.                         </EditItemTemplate>
  25.                     </asp:TemplateColumn>
  26.                     <asp:TemplateColumn Visible="False" HeaderText="Signedby">
  27.                         <ItemTemplate>
  28.                             <asp:Label id=Label1 runat="server" NAME="Label1" Text='<%# DataBinder.Eval(Container, "DataItem.Signedby") %>'>
  29.                             </asp:Label>
  30.                         </ItemTemplate>
  31.                         <EditItemTemplate>
  32.                             <asp:TextBox id=SignedTextBox runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Signedby") %>'>
  33.                             </asp:TextBox>
  34.                             <asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server" Width="128px" ErrorMessage="Enter Value"
  35.                                 ControlToValidate="SignedTextBox"></asp:RequiredFieldValidator>
  36.                         </EditItemTemplate>
  37.                     </asp:TemplateColumn>
  38.                     <asp:TemplateColumn Visible="False" HeaderText="Takenby">
  39.                         <ItemTemplate>
  40.                             <asp:Label id="Label3" runat="server"></asp:Label>
  41.                         </ItemTemplate>
  42.                         <EditItemTemplate>
  43.                             <asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
  44.                             <asp:RequiredFieldValidator id="RequiredFieldValidator3" runat="server" ErrorMessage="Enter Value" ControlToValidate="TextBox1"></asp:RequiredFieldValidator>
  45.                         </EditItemTemplate>
  46.                     </asp:TemplateColumn>
  47.                     <asp:TemplateColumn Visible="False" HeaderText="Comments">
  48.                         <ItemTemplate>
  49.                             <asp:Label runat="server"></asp:Label>
  50.                         </ItemTemplate>
  51.                         <EditItemTemplate>
  52.                             <asp:TextBox runat="server"></asp:TextBox>
  53.                         </EditItemTemplate>
  54.                     </asp:TemplateColumn>
  55.                     <asp:TemplateColumn HeaderText="Edit">
  56.                         <ItemTemplate>
  57.                             <asp:LinkButton runat="server" CausesValidation="false" CommandName="Edit" Text="Edit" ID="Linkbutton1"></asp:LinkButton>
  58.                         </ItemTemplate>
  59.                         <EditItemTemplate>
  60.                             <asp:LinkButton runat="server" CommandName="Update" Text="Update" ID="Linkbutton2"></asp:LinkButton>
  61.                             <asp:LinkButton runat="server" CausesValidation="false" CommandName="Cancel" Text="Cancel" ID="Linkbutton3"></asp:LinkButton>
  62.                         </EditItemTemplate>
  63.                     </asp:TemplateColumn>
  64.                 </Columns>
  65.             </asp:datagrid>
Nov 15 '07
23 1946
Frinavale
9,735 Recognized Expert Moderator Expert
hi i did it but its like showing me a blank page wehn i click edit...y is it so???
I think it's because you're not setting the source.
You need to set the DataSource before binding in the edit.
Try storing your DataSource object in Session and resetting your Grid's DataSource to this before DataBind in your Edit function.

Get back to me on whether or not it worked.

(PS you've Almost got the [code] tags working for you! just don't use vb.net...use vbnet instead! hehe)
Nov 16 '07 #11
tanya2001
23 New Member
I think it's because you're not setting the source.
You need to set the DataSource before binding in the edit.
Try storing your DataSource object in Session and resetting your Grid's DataSource to this before DataBind in your Edit function.

Get back to me on whether or not it worked.

(PS you've Almost got the [code] tags working for you! just don't use vb.net...use vbnet instead! hehe)
hiya sorry to bother u

but can u plz write down the code for me as m all new 2 .net i dunno much abt this plzzzz...n yippeee i have finally learnt the code tags....(cheers 2 u)
Nov 16 '07 #12
Frinavale
9,735 Recognized Expert Moderator Expert
hiya sorry to bother u

but can u plz write down the code for me as m all new 2 .net i dunno much abt this plzzzz...n yippeee i have finally learnt the code tags....(cheers 2 u)
Normally we don't write code for you. The experts/moderators/administrators are here to help you understand the problem so that you can solve it.

But I'm going to show you what I mean through code anyway...
Expand|Select|Wrap|Line Numbers
  1.  Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2.  
  3.  
  4.       If IsPostBack = False Then
  5.  
  6.         Dim cn As New SqlConnection("Server=SERVER;uid=sa;pwd=;Database=Central")
  7.         Dim da As New SqlDataAdapter("select * from Table3 where Lognumm= '" & Request.QueryString("ID") & "' and Flag=1", cn)
  8.         Dim dt As New DataTable
  9.         da.Fill(dt)
  10.         da.Dispose()
  11.         cn.Dispose()
  12.         Session("dt") =  dt 'I am storing the data source in Session so that we can use it again upon postback.
  13.         Me.DataGrid1.DataSource = dt
  14.         Me.DataGrid1.DataBind()
  15.  
  16.         End If
  17.     End Sub
  18. '........................................
  19.     Protected Sub DataGrid1_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.EditCommand
  20.         DataGrid1.Columns(8).Visible = True
  21.         DataGrid1.Columns(9).Visible = True
  22.         DataGrid1.Columns(10).Visible = True
  23.         DataGrid1.Columns(11).Visible = True
  24.  
  25.         DataGrid1.EditItemIndex = e.Item.ItemIndex
  26.         DataGrid1.DataSource = Ctype( Session("dt"), DataTable) 'Here I'm grabbing the data source from session so that we actually bind Data to the data grid...instead of nothing
  27.         DataGrid1.DataBind()
  28.  
  29.     End Sub
For more information on Sessions please see the .NET Article on Sessions
Nov 16 '07 #13
tanya2001
23 New Member
Normally we don't write code for you. The experts/moderators/administrators are here to help you understand the problem so that you can solve it.

But I'm going to show you what I mean through code anyway...
Expand|Select|Wrap|Line Numbers
  1.  Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2.  
  3.  
  4.       If IsPostBack = False Then
  5.  
  6.         Dim cn As New SqlConnection("Server=SERVER;uid=sa;pwd=;Database=Central")
  7.         Dim da As New SqlDataAdapter("select * from Table3 where Lognumm= '" & Request.QueryString("ID") & "' and Flag=1", cn)
  8.         Dim dt As New DataTable
  9.         da.Fill(dt)
  10.         da.Dispose()
  11.         cn.Dispose()
  12.         Session("dt") =  dt 'I am storing the data source in Session so that we can use it again upon postback.
  13.         Me.DataGrid1.DataSource = dt
  14.         Me.DataGrid1.DataBind()
  15.  
  16.         End If
  17.     End Sub
  18. '........................................
  19.     Protected Sub DataGrid1_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.EditCommand
  20.         DataGrid1.Columns(8).Visible = True
  21.         DataGrid1.Columns(9).Visible = True
  22.         DataGrid1.Columns(10).Visible = True
  23.         DataGrid1.Columns(11).Visible = True
  24.  
  25.         DataGrid1.EditItemIndex = e.Item.ItemIndex
  26.         DataGrid1.DataSource = Ctype( Session("dt"), DataTable) 'Here I'm grabbing the data source from session so that we actually bind Data to the data grid...instead of nothing
  27.         DataGrid1.DataBind()
  28.  
  29.     End Sub
For more information on Sessions please see the .NET Article on Sessions
yes i got it thanx a heap....thanks alot i was rely worried abt this...
can i ask u another qeury on my project plzz
Nov 16 '07 #14
Frinavale
9,735 Recognized Expert Moderator Expert
yes i got it thanx a heap....thanks alot i was rely worried abt this...
can i ask u another qeury on my project plzz
I'm glad to have helped.
Please post a new thread in the .NET Forum about your other question :)
(unless, of course, it's related to this one)

-Frinny
Nov 16 '07 #15
tanya2001
23 New Member
I'm glad to have helped.
Please post a new thread in the .NET Forum about your other question :)
(unless, of course, it's related to this one)

-Frinny
hi yes its related 2 this so m posting it here

well d first 2 field in this r getting updated but then wen i have added 2 more fields in this its not updating...y is it so?
m giving u d code below
Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim Stocksent1 As TextBox = CType(e.Item.FindControl("TextBox2"), TextBox)
  3.         Dim Signed1 As TextBox = CType(e.Item.FindControl("SignedTextBox"), TextBox)
  4.         Dim Takenby1 As TextBox = CType(e.Item.FindControl("TextBox1"), TextBox)
  5.         Dim Comments1 As TextBox = CType(e.Item.FindControl("TextBox4"), TextBox)
  6.         Dim Items1 As String = DataGrid1.DataKeys(e.Item.ItemIndex).ToString()
  7.         Dim myConnection As New SqlConnection("Server=SERVER;uid=sa;pwd=;Database=Central")
  8.         myConnection.Open()
  9.         myCommand1 = New SqlCommand("Update Table3 set Stocksent='" & Stocksent1.Text & "', Signedby='" & Signed1.Text & "',Takenby='" & Takenby1.Text & "', Comments='" & Comments1.Text & "', Flag=0, Sentdate=getdate() where Items='" & Items1 & "' ", myConnection)
  10. ra = myCommand1.ExecuteNonQuery()
  11.         myConnection.Close()
  12.         Response.Write("Records Updated")
  13.         DataGrid1.EditItemIndex = -1
  14.         DataGrid1.DataBind()
  15.         DataGrid1.Columns(8).Visible = False
  16.         DataGrid1.Columns(9).Visible = False
  17.         DataGrid1.Columns(10).Visible = False
  18.         DataGrid1.Columns(11).Visible = False
  19.         DataGrid1.Columns(12).Visible = False
  20.  
  21.  
Expand|Select|Wrap|Line Numbers
  1. <asp:datagrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 64px; POSITION: absolute; TOP: 296px"
  2.                 runat="server" Height="72px" BorderColor="#660033" BackColor="Wheat" ForeColor="DimGray" Width="848px"
  3.                 DataKeyField="Items" AutoGenerateColumns="False">
  4.                 <HeaderStyle Font-Bold="True" ForeColor="Chocolate" BackColor="LightGray"></HeaderStyle>
  5.                 <Columns>
  6.                     <asp:BoundColumn DataField="Lognumm" ReadOnly="True" HeaderText="Lognumm"></asp:BoundColumn>
  7.                     <asp:BoundColumn DataField="Requestdate" ReadOnly="True" HeaderText="Requestdate"></asp:BoundColumn>
  8.                     <asp:BoundColumn DataField="Hospital" ReadOnly="True" HeaderText="Hospital"></asp:BoundColumn>
  9.                     <asp:BoundColumn DataField="Items" ReadOnly="True" HeaderText="Items"></asp:BoundColumn>
  10.                     <asp:BoundColumn DataField="Currentstock" ReadOnly="True" HeaderText="Currentstock"></asp:BoundColumn>
  11.                     <asp:BoundColumn DataField="Stockrequest" ReadOnly="True" HeaderText="Stockrequest"></asp:BoundColumn>
  12.                     <asp:BoundColumn DataField="Priority" ReadOnly="True" HeaderText="Priority"></asp:BoundColumn>
  13.                     <asp:BoundColumn DataField="Comment" ReadOnly="True" HeaderText="Comment"></asp:BoundColumn>
  14.                     <asp:TemplateColumn HeaderText="Stocksent">
  15.                         <ItemTemplate>
  16.                             <asp:Label id=Label2 runat="server" Text='<%# DataBinder.Eval (Container.DataItem , "Stocksent") %>'>
  17.                             </asp:Label>
  18.                         </ItemTemplate>
  19.                         <EditItemTemplate>
  20.                             <asp:TextBox id=TextBox2 runat="server" Text='<%# DataBinder.Eval(Container.DataItem , "Stocksent") %>'>
  21.                             </asp:TextBox>
  22.                             <asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox2" ErrorMessage="Enter value"></asp:RequiredFieldValidator>
  23.                         </EditItemTemplate>
  24.                     </asp:TemplateColumn>
  25.                     <asp:TemplateColumn HeaderText="Signedby">
  26.                         <ItemTemplate>
  27.                             <asp:Label id=Label1 runat="server" NAME="Label1" Text='<%# DataBinder.Eval(Container, "DataItem.Signedby") %>'>
  28.                             </asp:Label>
  29.                         </ItemTemplate>
  30.                         <EditItemTemplate>
  31.                             <asp:TextBox id=SignedTextBox runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Signedby") %>'>
  32.                             </asp:TextBox>
  33.                             <asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server" Width="128px" ErrorMessage="Enter Value"
  34.                                 ControlToValidate="SignedTextBox"></asp:RequiredFieldValidator>
  35.                         </EditItemTemplate>
  36.                     </asp:TemplateColumn>
  37.                     <asp:TemplateColumn HeaderText="Takenby">
  38.                         <ItemTemplate>
  39.                             <asp:Label id="Label3" runat="server" Text='<%# DataBinder.Eval (Container, "DataItem.Takenby") %>'>
  40.                             </asp:Label>
  41.                         </ItemTemplate>
  42.                         <EditItemTemplate>
  43.                             <asp:TextBox id="TextBox1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Takenby") %>'>
  44.                             </asp:TextBox>
  45.                             <asp:RequiredFieldValidator id="RequiredFieldValidator3" runat="server" ErrorMessage="Enter Value" ControlToValidate="TextBox1"></asp:RequiredFieldValidator>
  46.                         </EditItemTemplate>
  47.                     </asp:TemplateColumn>
  48.                     <asp:TemplateColumn HeaderText="Comments">
  49.                         <ItemTemplate>
  50.                             <asp:Label id="Label4" runat="server" Text='<%# DataBinder.Eval (Container, "DataItem.Comments") %>'>
  51.                             </asp:Label>
  52.                         </ItemTemplate>
  53.                         <EditItemTemplate>
  54.                             <asp:TextBox id="TextBox3" runat="server" Text='<%# DataBinder.Eval (Container, "DataItem.Comments") %>'>
  55.                             </asp:TextBox>
  56.                         </EditItemTemplate>
  57.                     </asp:TemplateColumn>
  58.                     <asp:TemplateColumn HeaderText="Edit">
  59.                         <ItemTemplate>
  60.                             <asp:LinkButton runat="server" CausesValidation="false" CommandName="Edit" Text="Edit" ID="Linkbutton1"></asp:LinkButton>
  61.                         </ItemTemplate>
  62.                         <EditItemTemplate>
  63.                             <asp:LinkButton runat="server" CommandName="Update" Text="Update" ID="Linkbutton2"></asp:LinkButton>
  64.                             <asp:LinkButton runat="server" CausesValidation="false" CommandName="Cancel" Text="Cancel" ID="Linkbutton3"></asp:LinkButton>
  65.                         </EditItemTemplate>
  66.                     </asp:TemplateColumn>
  67.                 </Columns>
  68.             </asp:datagrid>
  69.  
ERROR:

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullRefe renceException: Object reference not set to an instance of an object.


Line 66: myCommand1 = New SqlCommand("Upd ate Table3 set Stocksent='" & Stocksent1.Text & "', Signedby='" & Signed1.Text & "',Takenby= '" & Takenby1.Text & "', Comments='" & Comments1.Text & "', Flag=0, Sentdate=getdat e() where Items='" & Items1 & "' ", myConnection)
Nov 19 '07 #16
Frinavale
9,735 Recognized Expert Moderator Expert
hi yes its related 2 this so m posting it here

well d first 2 field in this r getting updated but then wen i have added 2 more fields in this its not updating...y is it so?
m giving u d code below...
ERROR:

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullRefe renceException: Object reference not set to an instance of an object.


Line 66: myCommand1 = New SqlCommand("Upd ate Table3 set Stocksent='" & Stocksent1.Text & "', Signedby='" & Signed1.Text & "',Takenby= '" & Takenby1.Text & "', Comments='" & Comments1.Text & "', Flag=0, Sentdate=getdat e() where Items='" & Items1 & "' ", myConnection)
This type of error means that you are trying to use a variable before it has been initialized. For each object you should be using "new". Since you are grabbing these objects from the DataGrid, I recommend checking to see if any of them are are nothing....

Eg
Expand|Select|Wrap|Line Numbers
  1. If Stocksent1 Is Nothing Then
  2. 'if you try to use Stocksent1 when it is nothing you will get this error.
  3. 'Do something here to avoid your exception
  4. End If
Also, just a side note here but it's important, you shouldn't be using input directly from the user for creating your database query. This is dangerous and could result in your site being hacked.

Please see the .NET article on how to use a database in your program for an example on how to use these parameters correctly. This may also help you to figure out which variable is actually causing your error as well.

-Frinny
Nov 19 '07 #17
tanya2001
23 New Member
This type of error means that you are trying to use a variable before it has been initialized. For each object you should be using "new". Since you are grabbing these objects from the DataGrid, I recommend checking to see if any of them are are nothing....

Eg
Expand|Select|Wrap|Line Numbers
  1. If Stocksent1 Is Nothing Then
  2. 'if you try to use Stocksent1 when it is nothing you will get this error.
  3. 'Do something here to avoid your exception
  4. End If
Also, just a side note here but it's important, you shouldn't be using input directly from the user for creating your database query. This is dangerous and could result in your site being hacked.

Please see the .NET article on how to use a database in your program for an example on how to use these parameters correctly. This may also help you to figure out which variable is actually causing your error as well.

-Frinny

alright..but wen i was using the 1st 2 fields it worked wen ma dding these 2 new fields in d same way its not working..though wen i comment them n work d first 2 still work..though all of them have been initialized d same way....
Nov 19 '07 #18
tanya2001
23 New Member
alright..but wen i was using the 1st 2 fields it worked wen ma dding these 2 new fields in d same way its not working..though wen i comment them n work d first 2 still work..though all of them have been initialized d same way....
i got the answer i was just doin a simple mistake by giving a wrong textbox name....thanx 4 ur help anywayz.. posting a new query on crystal reports...help me out if u can in it...tc
Nov 19 '07 #19
Frinavale
9,735 Recognized Expert Moderator Expert
i got the answer i was just doin a simple mistake by giving a wrong textbox name....thanx 4 ur help anywayz.. posting a new query on crystal reports...help me out if u can in it...tc
Good work!
Feel free to ask for help any time :)
Nov 19 '07 #20

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1178
by: Brett Hargreaves | last post by:
I'm having a major problems with Datagrid and the update command. Basically when I enter into edit mode in my data grid then set a new value, the update command is not picking up the new value. So, if the original value is 10, and I change it to 20 the txtFieldName.Text field still thinks it has the old value of 10 in it. Anyone any ideas why!!! Cheers Brett
2
2335
by: Tomas Vera | last post by:
Hello All, I'm having problems creating a page with dynamic checkboxes in a WebApp. In my app, I need to query a database, then (based on results) add checkboxes to my form and set their "Checked" state. Since the controls are dynamically created, I'm using the OnInit event to create the checkboxes and set the "Checked" state from the DB. Next, I want to capture the postback event (AutoPostBack=true) and update my database based on...
1
1505
by: Jim McDermott | last post by:
A client I provide lan support to posed a web app question I'm not qualified to answer.... They build OEM mechanisms to order from an assortment of stock parts - I know this is a stretch, but kind of like autos. You pick a base model, then make a engine selection, then select color, etc. Of course, each subsequent choice is predicated on the previous choice, narrowing and defining the item as you go. Tables of validated choices...
3
1625
by: Martin | last post by:
I am a .Net newbie. I have Visual Studio.Net 2003 and have the luxury of being able to do some R&D/learning in a non-production environment. I want to develop a web application that will get the data that it serves out from two sources: (1) a database (probably MS Access but could be SQL Server) and (2) directly from another application running on the same machine. (BTW, this is on an intranet - the server will be dedicated to these apps...
0
908
by: mjc9885 | last post by:
Hope someone can help me out with this. I made some minor modifications to some underlying VB code for a web app -- no changes to any .aspx pages were required. I then deployed the changes to a test environment and everything worked fine. I used XCopy method to do this -- Copied the project to a localhost directory, then copied the dll's from there to the test environment. Like I said, after that the changes were visible in the test...
5
4715
by: terryc | last post by:
Hi Guys I've set up a web app on my machine using IIS and XP Pro. I can access the site using my machine (http://localhost/appName) no problems, but when I try and access this app using another machine over the network (http://192.XXX.X.X/appName) it just times out. Any ideas what the problem would be? I've just changed machine, previous to this I was running windows 2000 and I could access the app over the network with no problems. ...
4
1576
by: Andrew Robinson | last post by:
I am working on a system system that requires optimistic concurrency within a web app. At first I thought this would be easy. We generate our own entities and dal/service layer but I now see that working with controls like a grid view pose some very complicated issues. If I am using rowversion, when do I start the "clock"? When I first display the label version of a field? when I display the data within a textbox for edit or when I read...
3
1335
by: tanya2001 | last post by:
hi m bac 2 trouble u agn can u tell me how do i update a datagrid which has got a datagrid which is displayed on a button click and thn it tht datagrid thr's a link which has 2 be updated...wen m clicking edit on the datagrid nothing is returning back...what shud i give in the page post back event?i cant give d code for datagrid coz tht shud b displayed only when a button is clicked...wwhat do i do
2
1186
by: CMoya | last post by:
Can anyone point to an article or blog that describes the *functional* differences between a "Web Application" and a "Web Site" in VS2008.... caveats, gotchas? I'm aware of the compile differences as it was in VS2005 (one dll, vs multiple), but is there anything else to keep in mind? Like some things that might work in one but not the other?
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8904
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7741
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.