Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > ASP, ASP.NET and Coldfusion

ASP, ASP.NET and Coldfusion Microsoft's Web Development Language (ASP/ASP.NET) and Coldfusion discussion

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-19-2007, 04:48 AM
MastaKay MastaKay is offline
Newbie
 
Join Date: Nov 2007
Posts: 7
Rep Power: 0
MastaKay is on a distinguished road
Talking Updating MS Access from datagrid

Hi guys.Im looking to update my database from my datagrid.

My previous code is like this, so Im hoping sumone will assist me in doing so.
Code:
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

Last edited by xXHalfSliceXx; 11-20-2007 at 12:47 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill DataGrid with content question hoser2001 C# Programming 2 03-30-2008 12:02 PM
[PHP] Faking Shell Access Through PHP pranky PHP Tutorials 2 03-29-2007 06:28 AM
Access server file from Client ahpooh Visual Basic Programming 2 02-14-2007 06:51 PM
Java:Tutorial - Access Modifiers John Java Tutorials 0 12-09-2006 09:57 AM
HXTT Access 2.0.003 Kernel Software Development Tools 0 09-28-2006 07:12 AM


All times are GMT -5. The time now is 10:34 AM.

Contest Stats

Xav ........ 164.00000
dargueta ........ 128.00000
John ........ 127.00000
gaylo565 ........ 18.00000
XaNaX ........ 15.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

Ads