Click here to Skip to main content
15,898,134 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: submitting form with select - question Pin
Christian Graus30-Mar-09 15:25
protectorChristian Graus30-Mar-09 15:25 
QuestionUpdate in Gridview not working Pin
chilly44230-Mar-09 6:22
chilly44230-Mar-09 6:22 
AnswerRe: Update in Gridview not working Pin
Yusuf30-Mar-09 6:42
Yusuf30-Mar-09 6:42 
GeneralRe: Update in Gridview not working Pin
chilly44230-Mar-09 6:45
chilly44230-Mar-09 6:45 
GeneralRe: Update in Gridview not working Pin
Yusuf30-Mar-09 7:31
Yusuf30-Mar-09 7:31 
GeneralRe: Update in Gridview not working Pin
chilly44230-Mar-09 7:37
chilly44230-Mar-09 7:37 
GeneralRe: Update in Gridview not working Pin
Yusuf30-Mar-09 9:36
Yusuf30-Mar-09 9:36 
GeneralRe: Update in Gridview not working Pin
chilly44230-Mar-09 9:42
chilly44230-Mar-09 9:42 
Here is the code that I am using on the front end:
<asp:GridView 
     ID="GridView1" 
     runat="server" 
     Font-Size="X-Small" 
     Font-Names="Arial"
     AutoGenerateColumns="False" 
     OnRowEditing="GridView1_RowEditing" 
     OnRowUpdating="GridView1_RowUpdating" 
     OnRowCancelingEdit="GridView1_RowCancelingEdit" 
     OnRowDataBound="GridView1_RowDataBound" BorderColor="Black">
      <Columns>
       <asp:CommandField ShowEditButton="True" />
       <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"/>     
      </Columns>
     </asp:GridView>


Here is the code that I am using on the back end:
Dim sql As String = "SELECT ID FROM TEST"
       Dim da As New OleDbDataAdapter(Sql, Con)
       Con.ConnectionString = connString
       Con.Open()
       da.Fill(ds, "Events")
       GridView1.DataSource = ds
       GridView1.DataBind()
       count = ds.Tables("Events").Rows.Count
       Con.Close()


Dim sql As String
       sql = "UPDATE TEST SET ID = @ID WHERE (ID=@ID)"
       Using con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\WebSite1\App_Data\ODRT.mdb")
           Using cmd As New OleDbCommand(sql, con)
               cmd.CommandText = sql
               cmd.Parameters.AddWithValue("@ID", ID)
               con.Open()
               cmd.ExecuteNonQuery()
               con.Close()
               GridView1.EditIndex = -1
               DataBind()
           End Using
       End Using


Chilly
GeneralRe: Update in Gridview not working Pin
Yusuf30-Mar-09 9:45
Yusuf30-Mar-09 9:45 
GeneralRe: Update in Gridview not working Pin
chilly44230-Mar-09 9:46
chilly44230-Mar-09 9:46 
GeneralRe: Update in Gridview not working Pin
Yusuf30-Mar-09 9:56
Yusuf30-Mar-09 9:56 
GeneralRe: Update in Gridview not working Pin
chilly44230-Mar-09 11:33
chilly44230-Mar-09 11:33 
GeneralRe: Update in Gridview not working Pin
Yusuf30-Mar-09 11:52
Yusuf30-Mar-09 11:52 
GeneralRe: Update in Gridview not working Pin
chilly44230-Mar-09 12:02
chilly44230-Mar-09 12:02 
GeneralRe: Update in Gridview not working Pin
Yusuf30-Mar-09 12:35
Yusuf30-Mar-09 12:35 
GeneralRe: Update in Gridview not working Pin
chilly4429-Jun-09 8:40
chilly4429-Jun-09 8:40 
GeneralRe: Update in Gridview not working Pin
Yusuf9-Jun-09 10:05
Yusuf9-Jun-09 10:05 
GeneralRe: Update in Gridview not working Pin
chilly4429-Jun-09 10:12
chilly4429-Jun-09 10:12 
GeneralRe: Update in Gridview not working Pin
Yusuf9-Jun-09 13:06
Yusuf9-Jun-09 13:06 
QuestionHow can I attach object like flash file?? Pin
lsh486love30-Mar-09 6:05
lsh486love30-Mar-09 6:05 
AnswerRe: How can I attach object like flash file?? Pin
Yusuf30-Mar-09 6:22
Yusuf30-Mar-09 6:22 
QuestionCapture IP once per site visit Pin
Mort.Strom30-Mar-09 5:29
Mort.Strom30-Mar-09 5:29 
AnswerRe: Capture IP once per site visit Pin
Yusuf30-Mar-09 6:50
Yusuf30-Mar-09 6:50 
GeneralRe: Capture IP once per site visit Pin
Mort.Strom30-Mar-09 9:27
Mort.Strom30-Mar-09 9:27 
AnswerRe: Capture IP once per site visit Pin
shukow30-Mar-09 8:24
shukow30-Mar-09 8:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.