Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am doing my mca final year project in asp.net using c# coding. this is the web based project. actually i need the coding for inserting the data to database.
Posted

Any ADO.Net book would tell that. And since you are doing MCA, I assume you have one. So, only thing left is reading it.
 
Share this answer
 
 
Share this answer
 
v2
Create database, create connection, and then use this code in your project to insert the data


<br />
string connStr = "Data Source=.;Initial Catalog=DatabaseName;Integrated Security=True";<br />
SqlConnection dbCon = new SqlConnection(connStr);<br />
SqlCommand sqlCmd;<br />
DataTable dbTbl;<br />
SQLCommand sqlCmd;<br />
sqlCmd = new SqlCommand();<br />
dbCon.Open();<br />
sqlCmd.CommandType = CommandType.StoredProcedure;<br />
sqlCmd.Connection = connStr ;<br />
sqlCmd.CommandText = ("INSERT INTO TABLE NAME VALUES(A,B,C) ");<br />
sqlCmd.ExecuteNonQuery()<br />
dbCon.Close();<br />


use this code and u will get inserted your data
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900