English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

please heilp any one I am pulling my hear out.
I am using this below code to read from MsAccess. but i dont know how to add, delet or modify rows.
As Data.DataView = CType(AccessDataSource1.Select(DataSourceSelectArguments.Empty), Data.DataView)

help

2007-02-27 23:18:12 · 2 answers · asked by kain_odeh 2 in Computers & Internet Programming & Design

I already used it to connect . but how can i add delete and modify

2007-02-27 23:50:29 · update #1

2 answers

Here's one way..get rid of the & _ I used to split the statements

Using MyConnection1 As New SqlConnection(ConfigurationManager.ConnectionStrings & _ ("ESW").ConnectionString)
MyConnection1.Open()

MyQuery = New System.Text.StringBuilder

MyQuery.AppendLine("UPDATE AGENT ")
MyQuery.AppendLine("SET EMAIL_Address = @EMAIL")
MyQuery.AppendLine("WHERE AGENT_ID = @ID; ")

Using MyCommand1 As New SqlCommand(MyQuery.ToString, MyConnection1)
MyCommand1.Parameters. & _
Add("@ID", SqlDbType.Int).Value = Session("StudentId")
MyCommand1.Parameters. & _
Add("@EMAIL", SqlDbType.NVarChar).Value = CStr(Session("NewEMail"))

Id = MyCommand1.ExecuteNonQuery()
End Using
End Using

2007-02-28 05:46:55 · answer #1 · answered by rod 6 · 0 0

use the dataform wizard its easy to you

2007-02-28 07:23:07 · answer #2 · answered by khalid a 1 · 0 0

fedest.com, questions and answers