hi sandeep,
i have the same doubt. cd you just describe it with a small example or direct us to some site which will solve our purpose.
Hi..
i will give u a sample code..
using System.Data.SqlClient; // importing d needed package
//now within d corresponding function(for eg. Button_Click) have the code like,
SqlConnection cn = new SqlConnection(); // creating a connection variable
String sqlQuery;
cn.ConnectionString = "ur connection string"
sqlQuery = "create table temp(no int,name nvarchar(50))";
cn.Open(); //opening d conn.
SqlCommand sqlcmd = new SqlCommand(sqlQuery, cn); //sqlcommand obj to execute d queries...
sqlcmd.ExecuteNonQuery(); //executing d query and now d table will b created...
cn.Close(); //closing d conn.
sqlQuery = "insert into temp values(1,'Mak')";
cn.Open();
sqlcmd.CommandText=sqlQuery;
sqlcmd.ExecuteNonQuery(); //executing insert query...
cn.Close();
And to have the data displayed in a ctrl like gridview u can use
SqlDataReader() class like,
SqlCommand sqlcmd;
sqlQuery="select * from temp";
cn.open();
sqlcmd = new SqlCommand(sqlQuery, cn);
SqlDataReader sreader = sqlcmd.ExecuteReader();
tempView.DataSource = sreader; //where tempView is ur GridView..
tempView.DataBind();
cn.close();
i think d following url will b helpful to u...
http://www.codeproject.com/useritems/SQLConnect.asp
and also u may get some good videos on "asp.net/learn/videos/"
thanx and rgrds,
sand...