Keyword not supported: 'provider'.
I get this arror when I run the following code.Any help will be appreciated.
<%@ Page language="c#" Codebehind="WebForm2.aspx.cs" AutoEventWireup="true" Inherits="aspdotnet.WebForm2"%>
<%@import Namespace="System.Data"%>
<%@ import Namespace="System.Data.SqlClient" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm2</title>
<script Runat="server">
void Page_Load(Object sender,EventArgs e)
{
Response.Write("In");
String strcon;
strcon=@"Provider=SQLOLEDB.1;";
strcon+=@"Integrated Security=SSPI;";
strcon+=@"Persist Security Info=False;";
strcon+=@"Initial Catalog=PRIYA;";
strcon+=@"Data Source=ROC06650";
SqlConnection myconn =new SqlConnection(strcon);//this line is highlighted in the error message.
SqlDataAdapter mycomm=new SqlDataAdapter("select * from baby",myconn);
DataSet ds=new DataSet();
mycomm.Fill(ds);
DataGrid1.DataSource=ds;
DataGrid1.DataBind();
Response.Write("connected");
}
</script>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:datagrid id="DataGrid1" Runat="server"></asp:datagrid><asp:button id="button1" Runat="server"></asp:button><asp:textbox id="text1" Runat="server"></asp:textbox></form>
</body>
</HTML>
|