|
 |
aspx_beginners thread: System.Data.SqlClient
Message #1 by "Isac Backlund" <isac@m...> on Wed, 25 Sep 2002 10:24:30 +0200
|
|
hi everyone!!
i´m having some trouble with a sqlConnection, i have this bit of code:
------------------------------------------
private void Button1_Click(object sender, System.EventArgs e)
{
sqlConnection myConn = new SqlConnection(@"Data Source=(local);Integrated Security=SSPI;Initial Catalog=kris");
sqlCommand myComm = new SqlCommand("doInsertSkale", myConn);
myComm.CommandType = new CommandType.StoredProcedure();
}
------------------------------------------
And it says the following:
------------------------------------------
c:\inetpub\wwwroot\WebApplication1\WebForm3.aspx.cs(497): The type or namespace name 'sqlConnection' could not be found (are you
missing a using directive or an assembly reference?)
c:\inetpub\wwwroot\WebApplication1\WebForm3.aspx.cs(498): The type or namespace name 'sqlCommand' could not be found (are you
missing a using directive or an assembly reference?)
------------------------------------------
i´m using the namespace for SQL server like this
------------------------------------------
using.System.Data.SqlClient;
------------------------------------------
WHAT IS WRONG!! Please help me
Message #2 by "Imar Spaanjaars" <Imar@S...> on Wed, 25 Sep 2002 10:39:05 +0200 (CEST)
|
|
Looks like a Case problem.
I think the type of an SqlConnection in C# should be SqlConnection instead
of sqlConnection.
Try this:
SqlConnection myConn = new SqlConnection(@"Data
Source=local);Integrated Security=SSPI;Initial Catalog=kris");
SqlCommand myComm = new SqlCommand("doInsertSkale", myConn);
myComm.CommandType = new CommandType.StoredProcedure();
HtH
Imar
> hi everyone!!
> i´m having some trouble with a sqlConnection, i have this bit of code:
>
> ------------------------------------------
> private void Button1_Click(object sender, System.EventArgs e)
> {
> sqlConnection myConn = new SqlConnection(@"Data
> Source=(local);Integrated Security=SSPI;Initial Catalog=kris");
> sqlCommand myComm = new SqlCommand("doInsertSkale", myConn);
> myComm.CommandType = new CommandType.StoredProcedure();
>
> }
> ------------------------------------------
>
> And it says the following:
> ------------------------------------------
> c:\inetpub\wwwroot\WebApplication1\WebForm3.aspx.cs(497): The type or
> namespace name 'sqlConnection' could not be found (are you missing a
> using directive or an assembly reference?)
> c:\inetpub\wwwroot\WebApplication1\WebForm3.aspx.cs(498): The type or
> namespace name 'sqlCommand' could not be found (are you missing a using
> directive or an assembly reference?)
> ------------------------------------------
>
> i´m using the namespace for SQL server like this
> ------------------------------------------
> using.System.Data.SqlClient;
> ------------------------------------------
>
Message #3 by "Isac Backlund" <isac@m...> on Wed, 25 Sep 2002 10:45:55 +0200
|
|
yes.....offcourse
----- Original Message -----
From: "Imar Spaanjaars" <Imar@S...>
To: "aspx_beginners" <aspx_beginners@p...>
Sent: Wednesday, September 25, 2002 10:39 AM
Subject: [aspx_beginners] Re: System.Data.SqlClient
> Looks like a Case problem.
>
> I think the type of an SqlConnection in C# should be SqlConnection instead
> of sqlConnection.
> Try this:
>
> SqlConnection myConn = new SqlConnection(@"Data
> Source=local);Integrated Security=SSPI;Initial Catalog=kris");
> SqlCommand myComm = new SqlCommand("doInsertSkale", myConn);
> myComm.CommandType = new CommandType.StoredProcedure();
>
> HtH
>
> Imar
>
>
>
>
> > hi everyone!!
> > i´m having some trouble with a sqlConnection, i have this bit of code:
> >
> > ------------------------------------------
> > private void Button1_Click(object sender, System.EventArgs e)
> > {
> > sqlConnection myConn = new SqlConnection(@"Data
> > Source=(local);Integrated Security=SSPI;Initial Catalog=kris");
> > sqlCommand myComm = new SqlCommand("doInsertSkale", myConn);
> > myComm.CommandType = new CommandType.StoredProcedure();
> >
> > }
> > ------------------------------------------
> >
> > And it says the following:
> > ------------------------------------------
> > c:\inetpub\wwwroot\WebApplication1\WebForm3.aspx.cs(497): The type or
> > namespace name 'sqlConnection' could not be found (are you missing a
> > using directive or an assembly reference?)
> > c:\inetpub\wwwroot\WebApplication1\WebForm3.aspx.cs(498): The type or
> > namespace name 'sqlCommand' could not be found (are you missing a using
> > directive or an assembly reference?)
> > ------------------------------------------
> >
> > i´m using the namespace for SQL server like this
> > ------------------------------------------
> > using.System.Data.SqlClient;
> > ------------------------------------------
> >
>
>
>
>
> ---
> Beginning ASP.NET Databases using VB.NET
> http://www.wrox.com/ACON11.asp?ISBN=1861006195
>
> Beginning ASP.NET Databases using C#
> http://www.wrox.com/ACON11.asp?ISBN=1861007418
>
> These books look at how we can create data-centric ASP.NET
> applications. Requiring some basic knowledge of ASP.NET,
> Access and SQL the authors guide you through the process
> of connecting and consuming information in a variety of
> ways. They are packed full of excellent illustrative code
> examples, demonstrating important fundamental principles.
>
|
|
 |