Manual Method for DataBase Connectivity to INSERT Record into DATABASE TABLE
Following steps needs to be followed if you want to have a manual database connectivity
1. Dim cn as New Data.SqlClient.SqlConnection
2. Dim cm as New Data.SqlClient.SqlCommand
3. Dim str as String
4. cn.ConnectionString="Data Source = servername\sqlexpress;Initial Catalog=databasename;Integrated Security=True"
5. cm.Connection =cn
6. cm.CommandType=Data.CommandType.Text
7. str="your Insert SQL statement goes here"
8. cm.commandText=str
9. cn.open()
10. cm.ExecuteNonQuery
11. cn.Close()
I have given above statements taken into considerations your VB/ASP .net interface. You are required to change the statements accordingly, depending on the language you're working on
1. Dim cn as New Data.SqlClient.SqlConnection
2. Dim cm as New Data.SqlClient.SqlCommand
3. Dim str as String
4. cn.ConnectionString="Data Source = servername\sqlexpress;Initial Catalog=databasename;Integrated Security=True"
5. cm.Connection =cn
6. cm.CommandType=Data.CommandType.Text
7. str="your Insert SQL statement goes here"
8. cm.commandText=str
9. cn.open()
10. cm.ExecuteNonQuery
11. cn.Close()
I have given above statements taken into considerations your VB/ASP .net interface. You are required to change the statements accordingly, depending on the language you're working on
Comments
Post a Comment