Wrox Programmer Forums
|
BOOK: Beginning Microsoft Visual Basic 2010
This is the forum to discuss the Wrox book Beginning Visual Basic 2010 by Thearon Willis, Bryan Newsome; ISBN: 9780470502228
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Microsoft Visual Basic 2010 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 August 3rd, 2010, 01:38 AM
Registered User
 
Join Date: Jul 2010
Posts: 1
Thanks: 1
Thanked 0 Times in 0 Posts
Default Connection String Ch 16

I've written the code in the book pg 500 and when I run the code I get a blank form with blank datagrid view.
I think my problem is probably the connection string.
Code:
     Dim objConnection As New SqlConnection _
    ("server=localhost\WROX\;database=pubs;user id=sa;password=wrox")
server=localhost is my computer?
WROX = What? where the file is located like c:\WROX
database=pubs I suppose pubs.mdf (right)
If I use windows authentication do I need user id=sa or passwork= wrox?
Any help is much appreciated
 
Old August 3rd, 2010, 09:30 AM
Authorized User
 
Join Date: May 2010
Posts: 70
Thanks: 4
Thanked 6 Times in 6 Posts
Send a message via Yahoo to GeneBuchite
Default Connection string is a bear.

If you replace "Local Host with your ComputerNaME, And Wrox With your Servername the connection should work.




The Quickest way I know of to get started with Conection String Issues is

1) Start a new Windows Forms Application.
2) From The Data Menu Select Add New Data Source The Wizzard will start

3) Select Database
4) Select DataSet
5) Click New Connection
6) Next to Data Source Click Change
7) Select Microsoft SQL Data Server
8) Click The Drop Down Arrow under Server Name
9) you might need to play with the Server Name And The Log on to the Server Radio Buttons until you find the right combination and correct password to display the database list in the Select or enter a database Name combobox

10) After Selecting Pubs, click Test Connection. IF Succeded then Click OKay
11) Click Next
12) Ensure "Save connection String " Is Clicked, Click Next
13) Click Tables So A check is visible Next to Tables, Click Finish
14) In the solution explorer you will notice that the wizzard added an "App.Config" Go Ahead And Open That
15)You Will Find The Connection String THere Similar to <Code>connectionString="Data Source=yourComputerName\YourServername;Initial Catalog=pubs;Integrated Security=True" </Code>


16) Go back to your chapter 16 Dataset example. and locate the connection String
17) Replace localhost\wrox With yourComputerName\YourServername, Being careful to observe capitalization, spaces and all syntax.

18 you should be able to run now

Good Luck. Hope This Helps
The Following User Says Thank You to GeneBuchite For This Useful Post:
DavidN (August 11th, 2010)
 
Old October 20th, 2011, 11:23 PM
Authorized User
 
Join Date: Oct 2011
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 16 Still have problems

Like DavidN, I to have written the code in the book pg 500 and when I run the code I get a blank form with blank datagrid view.
My problem may also be the connection string my computer and server have the same name My_Samsung, and I am using Vis studio 2010 Ultimate version, below is one of several codes I have tried with out success:

("server=my_samsung\;database=pubs;User ID=sa;Password=wrox")

I've been stuck on this for a week now, as you may gather I am realy new to all this. I tried the suggestion create a new form with a new data source but the code there did not work either. The server explorer window shows all the tables etc in pubs but the form is blank

Any help would be appreciated...

Regards
Derrick
 
Old October 21st, 2011, 06:29 AM
Authorized User
 
Join Date: May 2010
Posts: 70
Thanks: 4
Thanked 6 Times in 6 Posts
Send a message via Yahoo to GeneBuchite
Default Connection Strings.

I know you are frustrated. I remember those days vividly! Connection strings are a tricky thing. The instructions I posted to DavidN do not create any form. They just test the connection string. did you check the connection string in the "App.Config" page? It may be a case of your sql database was set up using different credentials, however if the tables show up after the instructions, and you copy & pasted the connection string, Then we will need to look for a different solution. Good Luck. We will get you connected. It is a computer, we are humans, we Are superior.
 
Old October 27th, 2011, 08:25 AM
Authorized User
 
Join Date: Oct 2011
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
Default Connecting String

I am still stuck on Page 484, I have reinstalled Vis Studio Ultimate and downloaded the pubs database but when I try to run the script in Vis Studio I get error messages now. Dont suppose you would like to remotely check my set up and I can watch watch you click on.

I think it is how I have installed the SQL server that is causing the problem, when I look at the "read me" file attached to the example database nonwe of the options are available Enterprise manager etc??????
 
Old November 2nd, 2011, 06:48 AM
Authorized User
 
Join Date: May 2010
Posts: 70
Thanks: 4
Thanked 6 Times in 6 Posts
Send a message via Yahoo to GeneBuchite
Default Connection Strings

I am sorry it took me so long to reply... I am working 80 hour weeks right now. I will have time to work on this issue with you sat. morning. can you e-mail me a screenshot of the error you recieve. also can you connect to your sql Database using SQL Server? if you can connect to the database, have you tried the steps in the previous post to DavidN? does VB connect that way. Can you see your tables in the solution explorer?

I cannot connect to your computer as I dont have the software to enable me to do that.
 
Old November 4th, 2011, 04:41 AM
Authorized User
 
Join Date: Oct 2011
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 16

Thanks Gene,

I have managed to dfo it unloaded everything and started again and "for some reason" it worked.

I appreciate your help
Regards
Derrick





Similar Threads
Thread Thread Starter Forum Replies Last Post
Search ch 13, ch 16 sporik BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 0 October 27th, 2009 04:44 PM
Ch 16 Replication trondta BOOK: Professional SQL Server 2005 Administration ISBN: 0-470-05520-0 0 October 12th, 2009 07:15 AM
Try it out:Ch 16 Dataset Example flhartley VB.NET 2002/2003 Basics 1 August 28th, 2009 07:00 AM
Ch 16 driver not found dmswdev JSP Basics 1 June 27th, 2003 05:15 AM





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