Am using the following program for insert the value in sql server 2005 using ASP.but i dont know how to connect the asp with sql server 2005.but i use the following program i got the error.how can i solve this?what is the other way to connect the aspo and sql server 2005 for insert the record?
<html xmlns="http://www.w3.org/1999/xhtml">
<head >
<title>Untitled Page</title>
</head>
<body>
<%
dim con, sql_insert, data_source="XEONSERVER\\SQLEXPRESS;Initial Catalog=abcd; User Id=abcd;password=abcd;";
sql_insert = "Insert into register values ('" + TextBox1.Text + "')";
set con = Server.CreateObject("ADODB.Connection");
con.Open data_source;
con.Execute sql_insert;
con.Close;
set conn = Nothing;
%>
<form action="Default.aspx" method="post">
Your name:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<input type="submit" value="Submit" />
</form>
</body>
</html>
I’m personally using this set of functions in my DBHelper class
You just need to paste the connection string instead of: “SettingsHelper.getConnection()”