Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > Visual Studio 2005
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 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 February 1st, 2006, 09:46 AM
Registered User
 
Join Date: Feb 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default application settings, data sources and wizards

I'm new to visual stuido and having trouble with the data sources that are created using the wizards. The wizards and data binding work great but what I'm not sure about it is how to have my app programatically select a sql server db when it's finished and rolled out to other systems? Do I affect the connection strings in application settings (app.config) programatically? Or is there just some really simple answer I'm missing?
 
Old February 2nd, 2006, 12:58 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

I think you will have to change the app.config manually once you roll it out.

Jim

 
Old March 27th, 2006, 05:21 AM
Registered User
 
Join Date: Feb 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Create a connection at runtime. I think you may have to change the connection string.
You can also create a DSN through your application.
Check your connection at run time

        Dim strCON As String = "<Connection String>"
        Dim strQuery As String = "Select * from TBL"
        Dim DA As SqlDataAdapter = Nothing
        Dim DS As DataSet = Nothing
        Try
            Dim CON As New SqlConnection(strCON)
            DA = New SqlDataAdapter(strQuery, CON)
            DS = New DataSet
            DA.Fill(DS, "TBL")
            CON.Close()
        Catch ex As Exception
            MsgBox("Error")
            Me.Close()
            Return
        End Try
        DataGrid1.DataSource = DS.Tables("TBL")







Similar Threads
Thread Thread Starter Forum Replies Last Post
Application Settings Editing / Use BrianWren Pro Visual Basic 2005 1 April 30th, 2008 04:03 PM
Hand Coding VS Data Wizards Bulldog BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 3 May 22nd, 2007 04:21 AM
Joining data from multiple data sources ClaesR BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9 0 August 28th, 2006 09:30 AM
Synchronizing 2 tables on 2 different data sources luai ADO.NET 3 February 24th, 2005 01:37 AM





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