sqlexception error in system.data.sqlclient.dll

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everyone, i'm a newbie to VB.NET programming and i need help here. I'm
current doing an application for pocket pc and i get this sqlexception error
when i try to retrieve stuff from the database. My guess is that the error
lies with the connection string. I've tried serveral different connection
string but i still get the error.

Try
cn = New System.Data.SqlClient.SqlConnection("DATA
SOURCE=L311C007; Initial Catalog=HEALTHCARE; Integrated Security=SSPI;")
cn.Open()
cmd.CommandText = "SELECT * FROM PERSON"
cmd.Connection = cn

Catch ex As System.Data.SqlClient.SqlException
result = "There was an SqlException.." & vbCrLf &
"Details..." & vbCrLf & ex.ToString()
MsgBox(result)
End Try

The connection strings that i have tried are:
User id=sa;password=;database=HEALTHCARE;server=L311C007

Data Source=L311C007,14433;Initial Catalog=HealthCare;User id=sa;password=;
 
Which line does the error occur on?

Also, can you post the exception message and the stack trace?

I also presume that the table you're trying to access is in the database?

Andrew
 
The error occured on the cn.open() line and the exception message is An
unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in
System.Data.SqlClient.dll Additional information: SqlException. The table i'm
trying to access is in the database. I've did a test connection in visual
studio.net and it was sucessful, but the error still occurs.
 
erm..i'm using VB.NET

Miha Markic said:
Is this an asp.net application?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

kies said:
The error occured on the cn.open() line and the exception message is An
unhandled exception of type 'System.Data.SqlClient.SqlException' occurred
in
System.Data.SqlClient.dll Additional information: SqlException. The table
i'm
trying to access is in the database. I've did a test connection in visual
studio.net and it was sucessful, but the error still occurs.
 
Yes, but is this a web or winforms application? :-)

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

kies said:
erm..i'm using VB.NET

Miha Markic said:
Is this an asp.net application?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

kies said:
The error occured on the cn.open() line and the exception message is An
unhandled exception of type 'System.Data.SqlClient.SqlException'
occurred
in
System.Data.SqlClient.dll Additional information: SqlException. The
table
i'm
trying to access is in the database. I've did a test connection in
visual
studio.net and it was sucessful, but the error still occurs.

:

Which line does the error occur on?

Also, can you post the exception message and the stack trace?

I also presume that the table you're trying to access is in the
database?

Andrew

:

Hi everyone, i'm a newbie to VB.NET programming and i need help
here.
I'm
current doing an application for pocket pc and i get this
sqlexception
error
when i try to retrieve stuff from the database. My guess is that the
error
lies with the connection string. I've tried serveral different
connection
string but i still get the error.

Try
cn = New System.Data.SqlClient.SqlConnection("DATA
SOURCE=L311C007; Initial Catalog=HEALTHCARE; Integrated
Security=SSPI;")
cn.Open()
cmd.CommandText = "SELECT * FROM PERSON"
cmd.Connection = cn

Catch ex As System.Data.SqlClient.SqlException
result = "There was an SqlException.." &
vbCrLf
&
"Details..." & vbCrLf & ex.ToString()
MsgBox(result)
End Try

The connection strings that i have tried are:
User id=sa;password=;database=HEALTHCARE;server=L311C007

Data Source=L311C007,14433;Initial Catalog=HealthCare;User
id=sa;password=;
 
oops sorry..mis-interpreted your question..it's a smart device application
for pocket pc

Miha Markic said:
Yes, but is this a web or winforms application? :-)

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

kies said:
erm..i'm using VB.NET

Miha Markic said:
Is this an asp.net application?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

The error occured on the cn.open() line and the exception message is An
unhandled exception of type 'System.Data.SqlClient.SqlException'
occurred
in
System.Data.SqlClient.dll Additional information: SqlException. The
table
i'm
trying to access is in the database. I've did a test connection in
visual
studio.net and it was sucessful, but the error still occurs.

:

Which line does the error occur on?

Also, can you post the exception message and the stack trace?

I also presume that the table you're trying to access is in the
database?

Andrew

:

Hi everyone, i'm a newbie to VB.NET programming and i need help
here.
I'm
current doing an application for pocket pc and i get this
sqlexception
error
when i try to retrieve stuff from the database. My guess is that the
error
lies with the connection string. I've tried serveral different
connection
string but i still get the error.

Try
cn = New System.Data.SqlClient.SqlConnection("DATA
SOURCE=L311C007; Initial Catalog=HEALTHCARE; Integrated
Security=SSPI;")
cn.Open()
cmd.CommandText = "SELECT * FROM PERSON"
cmd.Connection = cn

Catch ex As System.Data.SqlClient.SqlException
result = "There was an SqlException.." &
vbCrLf
&
"Details..." & vbCrLf & ex.ToString()
MsgBox(result)
End Try

The connection strings that i have tried are:
User id=sa;password=;database=HEALTHCARE;server=L311C007

Data Source=L311C007,14433;Initial Catalog=HealthCare;User
id=sa;password=;
 
I can tell from the connection string that you are attempting to connect to a
remote SQL server instance. Pocket PC .NET Compact Framework does not
support this and you will always get an error. The documentation is a bit
hazy, but what you need to research is SQL Server CE database developement.
SQL Svr CE is free for download from Microsoft and integrates with VS.Net.
As I said, the documentation is a bit hazy, but there are several good books
available to walk you through setup for both your developement and deployment
scenarios. I recommend SQL Server CE Database Developement with the .NET
Compact Framework by Rob Tiffany. In a nutshull, you cannot directly access
a remote SQL server from the compact framework. What you do is write all
your database code to work with the local SQL Svr CE engine on the handheld
device. It is the SQL Svr CE instance which will (when properly configured
with a backend web server coupled to a SQL Server instance) allow you to do
realtime data access against your main databases via your wireless lan. It
also supports database replication during hot syncing in case you simply need
a subset of data to be available on the handheld for time insensitive data
rather then live from the server.

Hope this helps.
Eric Latham

kies said:
oops sorry..mis-interpreted your question..it's a smart device application
for pocket pc

Miha Markic said:
Yes, but is this a web or winforms application? :-)

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

kies said:
erm..i'm using VB.NET

:

Is this an asp.net application?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

The error occured on the cn.open() line and the exception message is An
unhandled exception of type 'System.Data.SqlClient.SqlException'
occurred
in
System.Data.SqlClient.dll Additional information: SqlException. The
table
i'm
trying to access is in the database. I've did a test connection in
visual
studio.net and it was sucessful, but the error still occurs.

:

Which line does the error occur on?

Also, can you post the exception message and the stack trace?

I also presume that the table you're trying to access is in the
database?

Andrew

:

Hi everyone, i'm a newbie to VB.NET programming and i need help
here.
I'm
current doing an application for pocket pc and i get this
sqlexception
error
when i try to retrieve stuff from the database. My guess is that the
error
lies with the connection string. I've tried serveral different
connection
string but i still get the error.

Try
cn = New System.Data.SqlClient.SqlConnection("DATA
SOURCE=L311C007; Initial Catalog=HEALTHCARE; Integrated
Security=SSPI;")
cn.Open()
cmd.CommandText = "SELECT * FROM PERSON"
cmd.Connection = cn

Catch ex As System.Data.SqlClient.SqlException
result = "There was an SqlException.." &
vbCrLf
&
"Details..." & vbCrLf & ex.ToString()
MsgBox(result)
End Try

The connection strings that i have tried are:
User id=sa;password=;database=HEALTHCARE;server=L311C007

Data Source=L311C007,14433;Initial Catalog=HealthCare;User
id=sa;password=;
 
I'm currently running the application on an emulator on the desktop so would
it be possible for me to retrieve data from the sql server which resides on a
server on the network? Is there any way which i can do so?

Eric L said:
I can tell from the connection string that you are attempting to connect to a
remote SQL server instance. Pocket PC .NET Compact Framework does not
support this and you will always get an error. The documentation is a bit
hazy, but what you need to research is SQL Server CE database developement.
SQL Svr CE is free for download from Microsoft and integrates with VS.Net.
As I said, the documentation is a bit hazy, but there are several good books
available to walk you through setup for both your developement and deployment
scenarios. I recommend SQL Server CE Database Developement with the .NET
Compact Framework by Rob Tiffany. In a nutshull, you cannot directly access
a remote SQL server from the compact framework. What you do is write all
your database code to work with the local SQL Svr CE engine on the handheld
device. It is the SQL Svr CE instance which will (when properly configured
with a backend web server coupled to a SQL Server instance) allow you to do
realtime data access against your main databases via your wireless lan. It
also supports database replication during hot syncing in case you simply need
a subset of data to be available on the handheld for time insensitive data
rather then live from the server.

Hope this helps.
Eric Latham

kies said:
oops sorry..mis-interpreted your question..it's a smart device application
for pocket pc

Miha Markic said:
Yes, but is this a web or winforms application? :-)

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

erm..i'm using VB.NET

:

Is this an asp.net application?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

The error occured on the cn.open() line and the exception message is An
unhandled exception of type 'System.Data.SqlClient.SqlException'
occurred
in
System.Data.SqlClient.dll Additional information: SqlException. The
table
i'm
trying to access is in the database. I've did a test connection in
visual
studio.net and it was sucessful, but the error still occurs.

:

Which line does the error occur on?

Also, can you post the exception message and the stack trace?

I also presume that the table you're trying to access is in the
database?

Andrew

:

Hi everyone, i'm a newbie to VB.NET programming and i need help
here.
I'm
current doing an application for pocket pc and i get this
sqlexception
error
when i try to retrieve stuff from the database. My guess is that the
error
lies with the connection string. I've tried serveral different
connection
string but i still get the error.

Try
cn = New System.Data.SqlClient.SqlConnection("DATA
SOURCE=L311C007; Initial Catalog=HEALTHCARE; Integrated
Security=SSPI;")
cn.Open()
cmd.CommandText = "SELECT * FROM PERSON"
cmd.Connection = cn

Catch ex As System.Data.SqlClient.SqlException
result = "There was an SqlException.." &
vbCrLf
&
"Details..." & vbCrLf & ex.ToString()
MsgBox(result)
End Try

The connection strings that i have tried are:
User id=sa;password=;database=HEALTHCARE;server=L311C007

Data Source=L311C007,14433;Initial Catalog=HealthCare;User
id=sa;password=;
 
I'm pretty much confused right now. I've read it somewhere that the .NET
Compact Framework can access a SQL Server 2000 server remotely using the
SqlClient .NET Data Provider..so i can access the data remotely?

kies said:
I'm currently running the application on an emulator on the desktop so would
it be possible for me to retrieve data from the sql server which resides on a
server on the network? Is there any way which i can do so?

Eric L said:
I can tell from the connection string that you are attempting to connect to a
remote SQL server instance. Pocket PC .NET Compact Framework does not
support this and you will always get an error. The documentation is a bit
hazy, but what you need to research is SQL Server CE database developement.
SQL Svr CE is free for download from Microsoft and integrates with VS.Net.
As I said, the documentation is a bit hazy, but there are several good books
available to walk you through setup for both your developement and deployment
scenarios. I recommend SQL Server CE Database Developement with the .NET
Compact Framework by Rob Tiffany. In a nutshull, you cannot directly access
a remote SQL server from the compact framework. What you do is write all
your database code to work with the local SQL Svr CE engine on the handheld
device. It is the SQL Svr CE instance which will (when properly configured
with a backend web server coupled to a SQL Server instance) allow you to do
realtime data access against your main databases via your wireless lan. It
also supports database replication during hot syncing in case you simply need
a subset of data to be available on the handheld for time insensitive data
rather then live from the server.

Hope this helps.
Eric Latham

kies said:
oops sorry..mis-interpreted your question..it's a smart device application
for pocket pc

:

Yes, but is this a web or winforms application? :-)

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

erm..i'm using VB.NET

:

Is this an asp.net application?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

The error occured on the cn.open() line and the exception message is An
unhandled exception of type 'System.Data.SqlClient.SqlException'
occurred
in
System.Data.SqlClient.dll Additional information: SqlException. The
table
i'm
trying to access is in the database. I've did a test connection in
visual
studio.net and it was sucessful, but the error still occurs.

:

Which line does the error occur on?

Also, can you post the exception message and the stack trace?

I also presume that the table you're trying to access is in the
database?

Andrew

:

Hi everyone, i'm a newbie to VB.NET programming and i need help
here.
I'm
current doing an application for pocket pc and i get this
sqlexception
error
when i try to retrieve stuff from the database. My guess is that the
error
lies with the connection string. I've tried serveral different
connection
string but i still get the error.

Try
cn = New System.Data.SqlClient.SqlConnection("DATA
SOURCE=L311C007; Initial Catalog=HEALTHCARE; Integrated
Security=SSPI;")
cn.Open()
cmd.CommandText = "SELECT * FROM PERSON"
cmd.Connection = cn

Catch ex As System.Data.SqlClient.SqlException
result = "There was an SqlException.." &
vbCrLf
&
"Details..." & vbCrLf & ex.ToString()
MsgBox(result)
End Try

The connection strings that i have tried are:
User id=sa;password=;database=HEALTHCARE;server=L311C007

Data Source=L311C007,14433;Initial Catalog=HealthCare;User
id=sa;password=;
 
You are correct in that the documentation does state that. It is supposed to
be possible to directly connect to a remote SQL server instance. However,
there is a long list of restrictions (both for the client and server) anyone
of which will cause the connection attempt to fail. If anyone has
successfully written code to access a SQL server instance from the .NET
Compact Framework, I would like to hear about it. As I think back, I
remember losing about a weeks worth of productivity attempting to get that to
work. I found a single page in the documentation that listed what cannot be
done with the SQL client and not much else. That is why I went with the SQL
Server CE solution (if you look at the documentation, it seems pretty clear
that Microsoft really prefers developers use the CE engine, since the entries
for it outnumber all the other data access entries combined). It provides
you with both a local data store and the ability to connect remotely. I had
it installed and successfully talking to my back end server in less then 2
hours, even in the emulator. If you don't get anywhere with the route you
are trying, I would definitely look at the CE stuff.

kies said:
I'm pretty much confused right now. I've read it somewhere that the .NET
Compact Framework can access a SQL Server 2000 server remotely using the
SqlClient .NET Data Provider..so i can access the data remotely?

kies said:
I'm currently running the application on an emulator on the desktop so would
it be possible for me to retrieve data from the sql server which resides on a
server on the network? Is there any way which i can do so?

Eric L said:
I can tell from the connection string that you are attempting to connect to a
remote SQL server instance. Pocket PC .NET Compact Framework does not
support this and you will always get an error. The documentation is a bit
hazy, but what you need to research is SQL Server CE database developement.
SQL Svr CE is free for download from Microsoft and integrates with VS.Net.
As I said, the documentation is a bit hazy, but there are several good books
available to walk you through setup for both your developement and deployment
scenarios. I recommend SQL Server CE Database Developement with the .NET
Compact Framework by Rob Tiffany. In a nutshull, you cannot directly access
a remote SQL server from the compact framework. What you do is write all
your database code to work with the local SQL Svr CE engine on the handheld
device. It is the SQL Svr CE instance which will (when properly configured
with a backend web server coupled to a SQL Server instance) allow you to do
realtime data access against your main databases via your wireless lan. It
also supports database replication during hot syncing in case you simply need
a subset of data to be available on the handheld for time insensitive data
rather then live from the server.

Hope this helps.
Eric Latham

:

oops sorry..mis-interpreted your question..it's a smart device application
for pocket pc

:

Yes, but is this a web or winforms application? :-)

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

erm..i'm using VB.NET

:

Is this an asp.net application?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

The error occured on the cn.open() line and the exception message is An
unhandled exception of type 'System.Data.SqlClient.SqlException'
occurred
in
System.Data.SqlClient.dll Additional information: SqlException. The
table
i'm
trying to access is in the database. I've did a test connection in
visual
studio.net and it was sucessful, but the error still occurs.

:

Which line does the error occur on?

Also, can you post the exception message and the stack trace?

I also presume that the table you're trying to access is in the
database?

Andrew

:

Hi everyone, i'm a newbie to VB.NET programming and i need help
here.
I'm
current doing an application for pocket pc and i get this
sqlexception
error
when i try to retrieve stuff from the database. My guess is that the
error
lies with the connection string. I've tried serveral different
connection
string but i still get the error.

Try
cn = New System.Data.SqlClient.SqlConnection("DATA
SOURCE=L311C007; Initial Catalog=HEALTHCARE; Integrated
Security=SSPI;")
cn.Open()
cmd.CommandText = "SELECT * FROM PERSON"
cmd.Connection = cn

Catch ex As System.Data.SqlClient.SqlException
result = "There was an SqlException.." &
vbCrLf
&
"Details..." & vbCrLf & ex.ToString()
MsgBox(result)
End Try

The connection strings that i have tried are:
User id=sa;password=;database=HEALTHCARE;server=L311C007

Data Source=L311C007,14433;Initial Catalog=HealthCare;User
id=sa;password=;
 
Back
Top