Switch to full style
You can find discussions, solutions and codes related to ASP.NET
Post a reply

How do I connect my form tomy database

Wed May 27, 2009 9:39 am

Hello, Please am new on C# and am using Ms Visuall studio 2008 to build a windows form using C# but I dont know how to connect my submit button to the database ms sql server 2005, so i can view the information entered from the form. Thank you



Re: How do I connect my form tomy database

Sun Oct 24, 2010 4:38 am

using System.Data.SqlClient;

String sqlQuery = "INSERT INTO table name Values (@,@,@,@,@,@)";
SqlConnection aConn = new SqlConnection("Data source= Your Computer name \\SQLEXPRESS; database= your database name ; Integrated Security = true");
SqlCommand aCommand = new SqlCommand(sqlQuery, aConn);



Regards
Joe

Post a reply
  Related Posts  to : How do I connect my form tomy database
 How do I connect my form tomy database     -  
 How to connect database with Applets     -  
 Unable to connect to JavaDB Database     -  
 Connect to database Microsoft access within jsp servlet     -  
 form to insert data, upload many files and images , database     -  
 How to connect two computers and connect them with Internet?     -  
 php login form (sign-in form)     -  
 connect to MYSQL from ASP     -  
 Connect Dots     -  
 HELP CONNECT SQL SERVER 2005 WITH PHP 5.2.6     -