Click here to Skip to main content
15,891,816 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Need top.location equivalent in asp.net code behind Pin
John-ph19-Nov-07 1:14
John-ph19-Nov-07 1:14 
GeneralRe: Need top.location equivalent in asp.net code behind Pin
Anurag Gandhi19-Nov-07 1:49
professionalAnurag Gandhi19-Nov-07 1:49 
GeneralRe: Need top.location equivalent in asp.net code behind Pin
Malcolm Smart19-Nov-07 2:41
Malcolm Smart19-Nov-07 2:41 
QuestionAsp Send Email with attachment Pin
Waseem_Kanafani19-Nov-07 0:11
Waseem_Kanafani19-Nov-07 0:11 
AnswerRe: Asp Send Email with attachment Pin
Fred_Smith19-Nov-07 0:15
Fred_Smith19-Nov-07 0:15 
GeneralRe: Asp Send Email with attachment Pin
Waseem_Kanafani19-Nov-07 2:10
Waseem_Kanafani19-Nov-07 2:10 
GeneralRe: Asp Send Email with attachment Pin
Malcolm Smart19-Nov-07 2:44
Malcolm Smart19-Nov-07 2:44 
Questionupdate database from datagrid Pin
matjame18-Nov-07 23:53
matjame18-Nov-07 23:53 
Hi guys.Im looking to update my database from my datagrid.
When u click on edit, it gives you an option to update or cancel action, so I need to update the database after making the change.Prolem with this code is that it work for txt boxes not datagrid, but it shudnt be that different.

My previous code is like this, so Im hoping sumone will assist me in doing so.
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged

If IsNumeric(txtFirstName.Text) Then
MsgBox("Please type your name in letters", MsgBoxStyle.Critical, "KNS System-Error")
Exit Sub
End If
If IsNumeric(txtCity.Text) Then
MsgBox("Please type your City in letters", MsgBoxStyle.Critical, "KNS System-Error")
Exit Sub
End If
If Not IsNumeric(txtPostalCode.Text) Then
MsgBox("Please type your PostalCode in numbers", MsgBoxStyle.Critical, "KNS-System-Error")
Exit Sub
End If
If Not IsNumeric(txtCelnumber.Text) Then
MsgBox("Please type your Cellphonenumber in numbers", MsgBoxStyle.Critical, "KNS-System-Error")
Exit Sub
End If
da = New OleDbDataAdapter("Select * From Employees", cn)
cb = New OleDbCommandBuilder(da)
ds = New DataSet
ds.Clear()
da.Fill(ds, "Employees")
dt = New DataTable
dt = ds.Tables("Employees")
Dim dr() As DataRow
dr = dt.Select("EmpID = " & txtEmpID.Text & "")
dr(0).BeginEdit()
'dr(0)("Client_ID") = txtClientID.Text
dr(0)("EFirstName") = txtFirstName.Text
dr(0)("ESurname") = txtSurname.Text
dr(0)("EDepartment") = cboDept.SelectedItem
dr(0)("EPassword") = txtPassword.Text
dr(0)("EConfirmPassword") = txtConfirm.Text
dr(0)("EPhonenumber") = mtxtPhoneNumber.Text
dr(0)("ECelnumber") = txtCelnumber.Text
dr(0)("EAddress") = txtAddress.Text
dr(0)("ECity") = txtCity.Text
dr(0)("EPostalcode") = txtPostalCode.Text
dr(0).EndEdit()
da.Update(ds, "Employees")
MsgBox("Record Edited Successfully")
Disabling()
End Sub

Problem is that this I did with text boxes.What Im looking for is updating directly from the datagrid.Thanx in advance


kagiso

AnswerRe: update database from datagrid Pin
matjame19-Nov-07 20:07
matjame19-Nov-07 20:07 
QuestionServer Application Unavailable [modified] Pin
Reddy Prakash18-Nov-07 23:45
Reddy Prakash18-Nov-07 23:45 
AnswerRe: Server Application Unavailable Pin
N a v a n e e t h18-Nov-07 23:49
N a v a n e e t h18-Nov-07 23:49 
AnswerRe: Server Application Unavailable Pin
Abhijit Jana18-Nov-07 23:52
professionalAbhijit Jana18-Nov-07 23:52 
GeneralRe: Server Application Unavailable Pin
N a v a n e e t h18-Nov-07 23:58
N a v a n e e t h18-Nov-07 23:58 
GeneralRe: Server Application Unavailable Pin
Abhijit Jana19-Nov-07 1:28
professionalAbhijit Jana19-Nov-07 1:28 
AnswerRe: Server Application Unavailable Pin
Kasi Viswanathan18-Nov-07 23:54
Kasi Viswanathan18-Nov-07 23:54 
AnswerRe: Server Application Unavailable Pin
Vasudevan Deepak Kumar19-Nov-07 0:06
Vasudevan Deepak Kumar19-Nov-07 0:06 
QuestionDisplay dynamic columns in Gridview? Pin
irkahc18-Nov-07 23:28
irkahc18-Nov-07 23:28 
AnswerRe: Display dynamic columns in Gridview? Pin
raj@code18-Nov-07 23:38
raj@code18-Nov-07 23:38 
AnswerRe: Display dynamic columns in Gridview? Pin
Sun Rays18-Nov-07 23:39
Sun Rays18-Nov-07 23:39 
QuestionSend Billing Address info to google checkout page Pin
Imran Khan Pathan18-Nov-07 23:22
Imran Khan Pathan18-Nov-07 23:22 
QuestionHow to display images that are outside the Application Folder Pin
raj@code18-Nov-07 23:16
raj@code18-Nov-07 23:16 
AnswerRe: How to display images that are outside the Application Folder Pin
Christian Graus18-Nov-07 23:34
protectorChristian Graus18-Nov-07 23:34 
GeneralRe: How to display images that are outside the Application Folder Pin
raj@code18-Nov-07 23:48
raj@code18-Nov-07 23:48 
GeneralRe: How to display images that are outside the Application Folder Pin
N a v a n e e t h18-Nov-07 23:56
N a v a n e e t h18-Nov-07 23:56 
AnswerRe: How to display images that are outside the Application Folder Pin
John-ph18-Nov-07 23:35
John-ph18-Nov-07 23:35 

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.