I have the following code but when I build this it gives me errors
that username, userpass, userfname does not exist in current context.
I don't know where is the problem and how can I fix this.
SqlConnection objConn = new SqlConnection("Data
Source=sql1300.mssqlservers.com;Initial Catalog=twcsan;Persist
Security Info=True;User ID=twcsan;Password=mln0531");
SqlCommand objCmd = new SqlCommand("UPDATE tbUsers SET
MyName = @username, " +
"MyPass = @userPass, " +
"UserFName = @userfname, " +
"WHERE UserId = 10", objConn);
objConn.Open();
objCmd.Parameters.AddWithValue(@username1, TextBox1.Text);
objCmd.Parameters.AddWithValue(@userPass,
this.TextBox2.Text);
objCmd.Parameters.AddWithValue(@userfname,
this.TextBox3.Text);
objCmd.ExecuteNonQuery();
objConn.Close();
Thanks in advance 3 960
On Apr 16, 2:58 pm, bba...@yahoo.com wrote:
I have the following code but when I build this it gives me errors
that username, userpass, userfname does not exist in current context.
I don't know where is the problem and how can I fix this.
SqlConnection objConn = new SqlConnection("Data
Source=sql1300.mssqlservers.com;Initial Catalog=twcsan;Persist
Security Info=True;User ID=twcsan;Password=mln0531");
SqlCommand objCmd = new SqlCommand("UPDATE tbUsers SET
MyName = @username, " +
"MyPass = @userPass, " +
"UserFName = @userfname, " +
"WHERE UserId = 10", objConn);
objConn.Open();
objCmd.Parameters.AddWithValue(@username1, TextBox1.Text);
objCmd.Parameters.AddWithValue(@userPass,
this.TextBox2.Text);
objCmd.Parameters.AddWithValue(@userfname,
this.TextBox3.Text);
objCmd.ExecuteNonQuery();
objConn.Close();
Thanks in advance
Within the AddWithValue function, enclose your parameter names in
quotes:
objCmd.Parameters.AddWithValue("@username", TextBox1.Text);
You just posted login info for that server on a public message
board...
On Apr 16, 1:58 pm, bba...@yahoo.com wrote:
I have the following code but when I build this it gives me errors
that username, userpass, userfname does not exist in current context.
I don't know where is the problem and how can I fix this.
SqlConnection objConn = new SqlConnection("Data
Source=sql1300.mssqlservers.com;Initial Catalog=twcsan;Persist
Security Info=True;User ID=twcsan;Password=mln0531");
SqlCommand objCmd = new SqlCommand("UPDATE tbUsers SET
MyName = @username, " +
"MyPass = @userPass, " +
"UserFName = @userfname, " +
"WHERE UserId = 10", objConn);
objConn.Open();
objCmd.Parameters.AddWithValue(@username1, TextBox1.Text);
objCmd.Parameters.AddWithValue(@userPass,
this.TextBox2.Text);
objCmd.Parameters.AddWithValue(@userfname,
this.TextBox3.Text);
objCmd.ExecuteNonQuery();
objConn.Close();
Thanks in advance
On Apr 16, 12:27 pm, "Evan M." <emorgoch.pub...@gmail.comwrote:
On Apr 16, 2:58 pm, bba...@yahoo.com wrote:
I have the following code but when I build this it gives me errors
that username, userpass, userfname does not exist in current context.
I don't know where is the problem and how can I fix this.
SqlConnection objConn = new SqlConnection("Data
Source=sql1300.mssqlservers.com;Initial Catalog=twcsan;Persist
Security Info=True;User ID=twcsan;Password=mln0531");
SqlCommand objCmd = new SqlCommand("UPDATE tbUsers SET
MyName = @username, " +
"MyPass = @userPass, " +
"UserFName = @userfname, " +
"WHERE UserId = 10", objConn);
objConn.Open();
objCmd.Parameters.AddWithValue(@username1, TextBox1.Text);
objCmd.Parameters.AddWithValue(@userPass,
this.TextBox2.Text);
objCmd.Parameters.AddWithValue(@userfname,
this.TextBox3.Text);
objCmd.ExecuteNonQuery();
objConn.Close();
Thanks in advance
Within the AddWithValue function, enclose your parameter names in
quotes:
objCmd.Parameters.AddWithValue("@username", TextBox1.Text);- Hide quoted text -
- Show quoted text -
Thanks a lot This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: js |
last post by:
Hi all,
I currently encounter a problem and it is urgent to me.
After calling the MsgBox.Show(), the message box is shown with non-modal
mode, what is the possible reason??? This only happen...
|
by: Liu Ju |
last post by:
Dear members:
I want to use the multithread in my program which is developed in
Visual C++ platform (version 6).
I created a controlling function:
UINT CCOMM1Dlg::WritingThreadFunc(LPVOID...
|
by: learner |
last post by:
Hi,
In a page, i have many links.
I have some functions in a global file which is included in all
linked pages.
I want to have a reference to a window which is to be opened on
clicking one link...
|
by: Mike |
last post by:
Hello,
I have a few rather urgent questions that I hope someone can help with (I
need to figure this out prior to a meeting tomorrow.) First, a bit of
background: The company I work for is...
|
by: Dimitri |
last post by:
PLEASE HELP,I HAVE A DATABSE WITH MULTIPLE RECORDS AS OUTLINED BELOW
EMP NO LEVEL NEXTINCREASE WAGETYPE UNIT
1000 1 0 1000
1000 1 0 1002 ...
|
by: Saps |
last post by:
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all...
|
by: Christopher |
last post by:
Urgent Help Needed: The EPVH-1.1 Visual Hull Library.
Dear All,
I am a student doing research in computer vision. The EPVH-1.1 Visual
Hull Library will really help a lot in my research.
I...
|
by: jenipriya |
last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors...
The table structures i hav
Employee (EmpID,...
|
by: ashasivan |
last post by:
Hi,
Please help me as soon as possible for the following problem. It is very very urgent.
I have an XML file as follows:
<?xml version="1.0" standalone="yes"?>
<Employee>
<em...
|
by: psantosh12 |
last post by:
Hello Frnds
Please need help to resolve error.......... it is very very urgent........
The error is
Runtime Error
Description: An application error occurred on the server. The current custom...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |