troubleshooting Question

insert into Database C#,

Avatar of rmtogether
rmtogether asked on
C#Microsoft SQL Server
3 Comments2 Solutions409 ViewsLast Modified:
I try to insert something into database (SQL server 2008). this is what I did so far.

could someone tell me does  my connection string is correct? and what is the next step that actual execute the "insert" to database

thanks in advance

OleDbConnection cn_input = new OleDbConnection();
string ConnStr_input = "Provider = SQLNCLI10; Server = (local); Database = Pb_project; Integrated Security=SSPI; DataTypeCompatibility=80; MARS Connection=True;";

cn_input.ConnectionString = ConnStr_input;

string insert_db = "INSERT INTO [value_tmp] (subject_ID,location,value) VALUES (2013,'London','Tokyo')";

Open in new window


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros