TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
peanut MC
NA
1
0
C# Q, reading from textboxes to a SQL DB.
Feb 26 2007 2:17 PM
Hi folks, first post so here it goes. I am getting an error when I attempt to save data from a selection of textboxes into a SQL server 2005 DB. I am using visual studio 2005, c#. Here is a sample of my code: //Add entered data into Remote Access Table(tblRemoteAccessDetails) protected void btnSaveRemoteAccessDetails_Click(object sender, EventArgs e) { string szSQL; szSQL = string.Format("INSERT INTO tblRemoteAccessDetails (RemoteAccessID, RemoteAccessIP, RemoteAccessmethod, RemoteAccessports, RemoteAccessUsername, RemoteAccesspassword, RemoteAccesscomments) VALUES({0}, {1}, '{1}', {1}, '{1}', '{1}', '{1}'", //Where to define ExecuteSQL? txtNewRemoteAccessID.Text, txtNewRemoteAccessIp.Text, txtNewRemoteAccessMethod.Text, txtNewRemoteAccessPorts.Text, txtNewRemoteAccessUsername.Text, txtNewRemoteAccessPassword.Text, txtNewRemoteAccessComments.Text); connection.ExecuteSQL(szSQL); Now, my question is I am getting the error: Error 109 'System.Data.SqlClient.SqlConnection' does not contain a definition for 'ExecuteSQL' Where do I define this method? In the web.config file? If so any ideas on how to do so, I feel if I get this error sorted I will be close to having my project working. I have tried MSDN help and various books but they are of little help with this error. Thanks for the feedback.
Reply
Answers (
1
)
get all the ip address in network?
switch between two properties