Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 31st, 2006, 11:30 AM
Registered User
 
Join Date: Oct 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Visual Studio 2005 DSN Connection

Good Morning

I am having trouble figuring out the code to connect to my SqlServer Db from my vb.net code using a system DSN.

Currently, I have this code working:

    Dim myConnect As New SqlConnection("Data Source=NOTEBOOK_DEV1;Initial Catalog=3D;Integrated Security=True")
    Dim myQuery As String = "Select U_RptSelLbl,U_RptSelName,U_RptSelTyp from [@LBSIRSEL] where U_RptMenuID = '" & g_MenuID & "'"
    Dim table As New DataTable
    Dim userCol As New DataColumn("User Entry", GetType(String))
    table.Columns.Add(userCol)
    Dim adapter As New SqlDataAdapter(myQuery, myConnect)
    adapter.Fill(table)

I will be getting, passed in code, an ODBC System DSN, Database Name, Password, Userid.
So, I need to convert my logic to use the system DSN instead of NOTEBOOK_DEV1.

All the code I try to reference the DSN with does not work. Is this a feasible scenario? If so, can you help with what I may be missing?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Studio 2005 - DataSet Connection Error obrienkev Visual Studio 2005 0 November 9th, 2007 05:45 AM
FTP in Visual Studio 2005 Pro (Visual Basic) shoopes VB How-To 1 June 29th, 2006 02:08 PM
Visual Studio 2003 vs. Visual Studio 2005 eitanbarazani C# 2005 4 May 9th, 2006 01:34 AM
Visual Studio .net2003 and Visual Studio 2005 Gert Visual C++ 1 January 24th, 2006 05:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.