List Info

Thread: ASP.Net Qyery




ASP.Net Qyery
country flaguser name
United States
2007-10-16 01:47:02

When i run below block of code at ExecutenonQuery the program gives me error that operation must use updateable query


Pl help me out in this matter




Dim Sqlstmt As String
Dim i As Integer
Dim objConn As New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source = D:KaushalMyFirstDB.mdb")
Sqlstmt = "Insert into Login Values('" & txtUserName.Text & "','" & txtPassword.Text & "')"
Dim objCmd As New OleDbCommand(Sqlstmt, objConn)
objConn.Open()
i = objCmd.ExecuteNonQuery()
objConn.Close()




---------------------------------
Don't let your dream ride pass you by. Make it a reality with Yahoo! Autos.

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity
Visit Your Group
Need traffic?

Drive customers

With search ads

on Yahoo!

Yoga Resources

on Yahoo! Groups

Take the stress

out of your life.

ASP.Net Qyery
country flaguser name
India
2007-10-16 04:41:24

Use this qry

Sqlstmt = "Insert into Login(username,password) Values('" & txtUserName.Text & "','" & txtPassword.Text & "')"

When i run below block of code at ExecutenonQuery the program gives
me error that operation must use updateable query


Pl help me out in this matter


Dim Sqlstmt As String
Dim i As Integer
Dim objConn As New
OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source = D:KaushalMyFirstDB.mdb")
Sqlstmt = "Insert into Login Values('" & txtUserName.Text & "','" &
txtPassword.Text & "')"
Dim objCmd As New OleDbCommand(Sqlstmt, objConn)
objConn.Open()
i = objCmd.ExecuteNonQuery()
objConn.Close()

---------------------------------
Now you can chat without downloading messenger. Click here to know how.

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
Re: ASP.Net Qyery
country flaguser name
United States
2007-10-17 11:32:32

You may find that changing your insert statement will help. Change
it to something like:
Sqlstmt = "Insert into Login (UserName, Password) Values('" &
txtUserName.Text & "','" & txtPassword.Text & "')"
Here I am using the column names of where the values should be
inserted into.

A second posibility would be to create a stored procedure for an
inesrt into the table and pass the needed values to the stored
procedure.

--- In AspNetAnyQuestionIsOk%40yahoogroups.com">AspNetAnyQuestionIsOkyahoogroups.com, captain 009
<captain_16281...> wrote:
&gt;
> When i run below block of code at ExecutenonQuery the program
gives me error that operation must use updateable query
&gt;
>
> Pl help me out in this matter
&gt;
>
>
>
> Dim Sqlstmt As String
&gt; Dim i As Integer
> Dim objConn As New OleDbConnection
(&quot;Provider=Microsoft.Jet.Oledb.4.0;Data Source =
D:KaushalMyFirstDB.mdb")
> Sqlstmt = "Insert into Login Values('&quot; & txtUserName.Text & "','&quot;
& txtPassword.Text & "')&quot;
> Dim objCmd As New OleDbCommand(Sqlstmt, objConn)
> objConn.Open()
>; i = objCmd.ExecuteNonQuery()
> objConn.Close()
&gt;
>
>
>
>
> ---------------------------------
> Don't let your dream ride pass you by. Make it a reality with
Yahoo! Autos.
>
> [Non-text portions of this message have been removed]
>

__._,_.___
.

__,_._,___
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )