Peter Feigl


I am following the video tutorials for VBX (quite good BTW) and am on Lesson 09. When I add a data source, the wizard does not produce a connection string. I am following the instructions exactly. What is wrong

Peter Feigl





Re: Connection String and VB.NET

Mike Wachal - MSFT


Why do you believe that no connection string is produced What are you expecting to see I don't know which set of video tutorials you're talking about as there are several.

When you create a data source in VB it creates the connection string and stores it in the settings file of the project you're working in. Normally it also creates a data set that automatically uses the connection string. You have to open up the settings file to see the connection string.

Mike







Re: Connection String and VB.NET

Jens K. Suessmeyer


Hi,

look in the Code behind and examine the connection object, right before the open method you can check the connectionstring property for the actual value. I doubt that VB didn¡¯t put something in place if you used the designer.

HTH, Jens K. Suessmeyer.

---
http://www.sqlserver2005.de
---






Re: Connection String and VB.NET

Barry Andrew

Also remember in VS you can right click the project in the object browser below the solution name and change various settings. In here you can specify a connection string and give it a name.

At any point you then wish to use this connection string simply type the name. For example I generally call my connections cnnSQL... then at any point I just type cnnSQL to call the connection string. This save a lot of time.

hth






Re: Connection String and VB.NET

Hemantgiri S. Goswami

Hi,

Refer http://www.connectionstrings.com/ fore more.

Hemantgiri S. Goswami






Re: Connection String and VB.NET

Peter Feigl


I am using the absolute beginner tutorials. Actually I think there must be a connection string because as I said, Test Connection succeeds, the string is just not displayed when you click on the connection string expander. It may be a VBX bug

Peter






Re: Connection String and VB.NET

Mike Wachal - MSFT

Hi Peter,

Did you track this down yet

If the connection succeeds, there is a connection string, I promise. The issue is understanding where to look. I'm not completely certain what you're looking at when you talk about the connection string expander, maybe you can give the exact steps you're using to try and view the connection string and I can see if I see the same behavior.

As I said before, VS stored the connection string it creates in the properties of the project. I downloaded the finished project for Lesson 9 (C# version since that's what I have on my computer, but they are identical other than the language used) and found the connection string used by the project as follows:

  1. Open the project.
  2. Double-click on the Project folder in the Project Explorer. (You can also right-click and choose Open)
  3. Switch to the Setting tab in the properties.

You should see a single entry for MyCompanyConnectionString which is the connection string (listed under the Value column) that is created by VS when you add the DataSet.

Let me know if this helps you find the connection string being used.

Mike