Need help with connectivity

Rookieme

Recruit
Guys im doing a project on college database as my mini project. Im planning to use VB front end and MSSQL backend. My friends tell me i need to device something for connectivity from front end to back end.

I am setting up a registration form (like one on mail server providers) and wish to upload details entered onto the Database. Im sure most of you know about this. It would be great if any of you can provide an example source code of something on this line.(any Front end-back end project would do) Im a noob and looking for drastic improvement in my programming skills, please help me.....
 
Simplest way to do it :

SqlConnection con = new SqlConnection();

con.ConnectionString = "Data Source=sqlservername;Initial Catalog = databasename; User ID=userid;Password=password";

SqlCommand cmd = new SqlCommand("insert into tablename
values('"+TextBoxName.Text+"')",con);

//comments : I have inserted value of only one field, you can continue with
// any number of fields like this.

con.Open();

cmd.ExecuteNonQuery();

con.Close();

Above program is in c# but you can use VB syntax on the same lines...

Hope this helps... :hap2:
 
Back
Top