tmaususer
asked on
Visual Studio 2010 and SQL Server
I have upgraded to a new laptop and version of Visual Studio 2010. When I open studio and create a new project and attempt to connect to a test database on my sql 2003 server I receive a message that says "This server version is not supported" You must use sql 2005 or later. I have tried to google this error but the solutions provided seem to be for VS 2008 and not 2010. Does anyone know if there is a work around for this or am I missing someting? I can connect successfully via odbc and through enterprise manager if that means anything.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok so I am a novice at programmng at best. I have tried this code but get an error. The error I get is on this line: Dim Global_strProdCN As String = Global_settings.Connection String
NullReferenceExceptionHand eled. I have not idea how to correct this given my "newbie" skills. The complete code is below.
Imports System.Data.SqlClient
Imports System.Configuration
Imports System
Imports System.IO
Imports System.Net.Mime.MediaTypeN ames
Public Class Form1
Dim Global_settings As ConnectionStringSettings
Public Global_strProdCN As String
Public Global_sqlProdCN As New SqlConnection
Public Global_ERPsettings As ConnectionStringSettings
Public Global_strERPCN As String
Public Global_sqlERPCN As New SqlConnection
Public Global_dr As SqlDataReader
Public Global_sqlcmd As New SqlCommand
Public Global_strsql As String
Public Global_strProdCN2 As String
Public Global_sqlProdCN2 As New SqlConnection
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Global_settings = System.Configuration.Confi gurationMa nager.Conn ectionStri ngs("Data Source=SERVER04N;Initial Catalog=yamahalabeldb;Inte grated Security=True")
Dim Global_strProdCN As String = Global_settings.Connection String
Dim irowcnt As Integer = -1
Global_strsql += " SELECT Part_no, Deliverylocation, po_no, supplier_id, labelcode, qty, duedate, stocklocation, sirlocation "
Global_strsql += " FROM yam_con_label "
Global_strsql += " Order by part_no "
Global_sqlProdCN = New SqlConnection(Global_strPr odCN)
Global_sqlProdCN.Open()
Global_sqlcmd = New SqlCommand(Global_strsql, Global_sqlProdCN)
Global_dr = Global_sqlcmd.ExecuteReade r()
If Global_dr.HasRows Then
While Global_dr.Read
irowcnt += 1
Dim srow() As String = {Global_dr.Item("Part_no") , Global_dr.Item("Deliverylo cation"), Global_dr.Item("po_no"), _
Global_dr.Item("supplier_i d"), Global_dr.Item("labelcode" ), Global_dr.Item("qty"), _
Global_dr.Item("duedate"), Global_dr.Item("stocklocat ion"), Global_dr.Item("sirlocatio n")}
dgYamahadata.Rows.Add(srow )
End While
End If
End Sub
Private Sub dgYamahadata_CellContentCl ick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataG ridViewCel lEventArgs ) Handles dgYamahadata.CellContentCl ick
End Sub
End Class
NullReferenceExceptionHand
Imports System.Data.SqlClient
Imports System.Configuration
Imports System
Imports System.IO
Imports System.Net.Mime.MediaTypeN
Public Class Form1
Dim Global_settings As ConnectionStringSettings
Public Global_strProdCN As String
Public Global_sqlProdCN As New SqlConnection
Public Global_ERPsettings As ConnectionStringSettings
Public Global_strERPCN As String
Public Global_sqlERPCN As New SqlConnection
Public Global_dr As SqlDataReader
Public Global_sqlcmd As New SqlCommand
Public Global_strsql As String
Public Global_strProdCN2 As String
Public Global_sqlProdCN2 As New SqlConnection
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Global_settings = System.Configuration.Confi
Dim Global_strProdCN As String = Global_settings.Connection
Dim irowcnt As Integer = -1
Global_strsql += " SELECT Part_no, Deliverylocation, po_no, supplier_id, labelcode, qty, duedate, stocklocation, sirlocation "
Global_strsql += " FROM yam_con_label "
Global_strsql += " Order by part_no "
Global_sqlProdCN = New SqlConnection(Global_strPr
Global_sqlProdCN.Open()
Global_sqlcmd = New SqlCommand(Global_strsql, Global_sqlProdCN)
Global_dr = Global_sqlcmd.ExecuteReade
If Global_dr.HasRows Then
While Global_dr.Read
irowcnt += 1
Dim srow() As String = {Global_dr.Item("Part_no")
Global_dr.Item("supplier_i
Global_dr.Item("duedate"),
dgYamahadata.Rows.Add(srow
End While
End If
End Sub
Private Sub dgYamahadata_CellContentCl
End Sub
End Class
ASKER
I will repost my code under another zone.
ASKER