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
Box
NA
51
41.7k
Entering data into access database
Jul 20 2011 10:41 AM
Im still in the learning stages and have spent the majority of today searching around trying to follow tutorials or get information on how to simply use sql (i know the sql 'language' as have worked with databases a long time via php,vba and access but c# is new to me and not as simple to conenct to (althoguh will be once i understand how to!)
The Error i get is: An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error.
my code is
{
private
void
button1_Click(
object
sender, System.EventArgs e)
string
istring = @"INSERT INTO tblUsers(username, distance) VALUES('Test',54321);";SqlConnection conn =
conn.Open();
new
SqlConnection(@"Data Source=L:\testing\in the distance\ITD.mdb");
SqlCommand cmd =
new
SqlCommand(istring, conn);
// this is where it debugs
cmd.ExecuteNonQuery();
if
(conn !=
null
)
{
conn.Close();
}
}
Thanx
Reply
Answers (
11
)
Retrieving column name from a database in ASP.NET
Save file location in SQL server