Home » Asp.net

how connect VWD 2010 Express to SQL server 2000


I'm using MS Visual Web Developer 2010 Express to build a website that connects to a SQL server 2000 database.  Is it possible to connect to SQL 2000 using providerName="System.Data.SqlClient"?  I'm guessing not.

Or am I limited to using providerName="System.Data.OleDb" ?   And seems both connections are under this ADO.NET umbrella. Please confirm one way or the other ... I'm a bit confused.

 From web.config:

    <add name="SubscrTypeConnectionString" connectionString="Provider=SQLOLEDB;Data Source=my-server-host;Persist Security Info=True;Password=123abcde;User ID=test;Initial Catalog=Apps"
   providerName="System.Data.OleDb" />

So I believe I need to use OleDbCommand calls. I've seen many examples to do gridview select/edit/delete using SqlClient but not OleDb calls in VB code. Links to sample code would be great.

Thank you!



2 Answers Found


Answer 1

These 2 MS websites below state that the System.Data.SqlClient can be used for Microsoft SQL Server 7.0 or a later.

However, in VWD 2010 design view on default.aspx, when I do :

'Configure data source' on a SqlDataSource to connect  to my SQL server 2000 (version 8, SP4) on another server, and select '.NET Framework provider for SQL server' (SqlClient), and do 'Test connection',

I get a pop-up box stating

        'This server version is not supported. You must have MS SQL server 2005 or later.'

In this first website with ADO.NET code example, i don't see the Provider.


The code in this example assumes that you can connect to the Northwind sample database on Microsoft SQL Server 7.0 or a later version.


.NET Framework Data Provider for SQL Server (SqlClient)

To use the .NET Framework Data Provider for SQL Server, you must have access to SQL Server 7.0 or later versions.

Any assistance would be appreciated!


Answer 2

Hi , i am not fimiliar to Sql 2000 and VWD 2010 working together or neither i  ever tryed it , but why not upgrade to SSMStudio 2008 http://www.microsoft.com/express/database/ ??

Then you can just import your old database to SSMS 2008 i hope .

Here is connections string for Sqlserver 2000

http://www.connectionstrings.com/sql-server   http://www.connectionstrings.com/sql-server

in C# codebehing add this

using System.Data.SqlClient;

protected void Page_Load(object sender, EventArgs e)
using (SqlConnection cnn = new SqlConnection("Persist Security Info=True;Data Source=datasource;database=; User ID=userid;password=password"))
                using (SqlCommand cmd = new SqlCommand(" SELECT [name] FROM sys.Tables ", cnn))

if you want it in VB.net code then use this program


Hope this helps



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure