Groups | Blog | Home
all groups > vb.net data > april 2006 >

vb.net data : VBNet 2005 and SQL Server



M
4/17/2006 4:27:39 PM

It seems to me the current VB.NET 2005 Express version does not support
connect to SQL Server 2000 or SQL Server 2005. Or I am not doing correctly.
I cannot even make the some samples project working

Thanks



Paul Clement
4/18/2006 7:24:43 AM
[quoted text, click to view]

¤
¤ It seems to me the current VB.NET 2005 Express version does not support
¤ connect to SQL Server 2000 or SQL Server 2005. Or I am not doing correctly.
¤ I cannot even make the some samples project working
¤

Could you be a bit more specific. How are you trying to connect? What sort of errors are you
getting?


Paul
~~~~
Chen
4/18/2006 9:02:31 AM

If I try add a connection in database Explorer

On database Explorer
I select "Add connection"
The Choose DataSource screen appear.
It alway assunme to connect to SQL server 2005
and let you select a MDF file.

After locate a MDF file and click test connection I get the error message:
An error has occured while establishing a connection to the server. When
connecting to SQL Server 2005, this failure may be caused by the fact that
under the daufault setting SQL Server does not allow remote connections
(provider: SQL Newwork interfaces, error:25 - connection string is not
valid)
Actually my SQL server 2005 database Engine set to using both TCP/IP and
named pipes,
allow remote connection.


If I try to open a SQL Database samples project:Creating and using User
Defined Types with SQL Server 2005

the message is

The project file "..Microsoft Visual Studio 8\Samples\Data\Creating and
using User Defined Types with SQL Server 2005\UDT\UDT.vbproject" cannot
opened.
The project type is not supported by this installiation.

[quoted text, click to view]


William (Bill) Vaughn
4/18/2006 9:50:52 AM
While I don't work with the Express edition of VS, it seems to me that the
Visual Studio UI does not support anything except the shared memory provider
which means that it won't permit you to connect to any data source that's
not on the same machine. That said, there is nothing to stop you from
creating a ConnectionString on your own to connect to any data source--local
or remote.


--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

[quoted text, click to view]

Paul Clement
4/18/2006 12:51:59 PM
[quoted text, click to view]

¤
¤ If I try add a connection in database Explorer
¤
¤ On database Explorer
¤ I select "Add connection"
¤ The Choose DataSource screen appear.
¤ It alway assunme to connect to SQL server 2005
¤ and let you select a MDF file.
¤
¤ After locate a MDF file and click test connection I get the error message:
¤ An error has occured while establishing a connection to the server. When
¤ connecting to SQL Server 2005, this failure may be caused by the fact that
¤ under the daufault setting SQL Server does not allow remote connections
¤ (provider: SQL Newwork interfaces, error:25 - connection string is not
¤ valid)
¤ Actually my SQL server 2005 database Engine set to using both TCP/IP and
¤ named pipes,
¤ allow remote connection.

Bill is correct. The GUI data tools in the Express Editions only support local databases. If you use
the ADO.NET libraries instead it works just fine.


Paul
~~~~
M
4/18/2006 3:02:13 PM

Thanks

Actually the VB 2005 express Set 'Just my code' enabled and no way to
change.
If I declare
Dim cn as New adodb.connection()
or
Dim cn as New SQLClient.sqlconnection(ConStr)
None of them Allow me add the statement
cn.open .
The message is declaration expected. ALthough I declare it just one line
ahead



[quoted text, click to view]


William (Bill) Vaughn
4/18/2006 6:27:40 PM
did you import the system.data.sqlclient DLL or add a reference to the
ADODB.DLL?

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

[quoted text, click to view]

M
4/21/2006 8:11:18 AM

Yes.I did both
the declare statements do not have problem. but VBEXPRESS ignore them.
I think Microsoft do not want the free software to do to much thing.



[quoted text, click to view]


William (Bill) Vaughn
4/21/2006 10:18:40 AM
I just tried it in code in a virgin Visual Studio Express setup here. It
works fine. Again, the Visual Studio IDE won't let you setup a Database
Explorer connection to external data sources but you can connect in code.
Did you add an Imports System.Data.SqlClient?


--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

[quoted text, click to view]

M
4/21/2006 11:22:25 AM

Thank, both of you are right.
Last time when I tested it, I was using a microsoft sample project.
I added few lines of the code but put them at wrong place-- outside a
procedure


[quoted text, click to view]


Paul Clement
4/21/2006 12:23:38 PM
[quoted text, click to view]

¤
¤ Yes.I did both
¤ the declare statements do not have problem. but VBEXPRESS ignore them.
¤ I think Microsoft do not want the free software to do to much thing.
¤

You might want to post some code if you are still having problems.


Paul
~~~~
Rui
4/28/2006 7:08:43 PM
VB 2005 Express doesn't support remote access to databases. You can only use local files.

William (Bill) Vaughn
4/29/2006 12:08:35 PM
Actually, that's not really true--at least not completely. While the user
interface in VS Express does not support remote databases, there is nothing
to stop you from writing code to do so.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

[quoted text, click to view]

AddThis Social Bookmark Button