0

I am new to VB, and have attempted to load all the free versions of the SQL
available. Dispite many go's I still can not make any work.
I go through the motions of including a database into my programs
but I keep geting a long delay then "Unable to find server message".
I have Express 2013 and Win 7, all work fine in all else.
Can any one please help me???.

4
Contributors
4
Replies
13
Views
3 Years
Discussion Span
Last Post by doncwilson_1
0

Thanks for your interest:
I have not got to the code yet.
While in VB 2013Express IDE, I try to add a DB(not made yet).
I can not get the SQL server to create a DB.
Error = Unable to find server instance.This after a long wait.

0

SQL Sever Express uses

(local)\SQLExpress or .\SQLExpress

Please use this as the data source. Then you can either create or add an existing database file (mdb)

0

Here's the code that I use to make the connection to the database:

    Public sConnection As String = "Data Source=Don-PC;Initial Catalog=DataDesignSolutions;Integrated Security = True;User ID=DON-PC;Password=acd67011;"
    Public con As New SqlConnection
    Public cmd As New SqlCommand
    Public strQ As String
    Public sql As String
con = New SqlConnection(sConnection)
            cmd.CommandText = "SELECT LocationID, SellPrice1, SellPrice2, SellPrice3, SellPrice4, SellPrice5, ItemCost, FreightCost, UDCost1, UDCost2, AverageCost, Classification, VendorNumber, AltVenNumber, LotShadeSerialOut, TaxableItem, RequireDeposit, DepositPcntReq, CommissionPcnt FROM INVENTORY_LOCATIONS WHERE ProductID = " & GlobalResources.prodID & " AND Location = " & GlobalResources.loc1
            con.Open()
            cmd.Connection = con
Dim rdr As SqlDataReader = cmd.ExecuteReader
            Do While rdr.Read()
                GlobalResources.locID = rdr(0)
                GlobalResources.prc1 = rdr(1)
                GlobalResources.prc2 = rdr(2)
                GlobalResources.prc3 = rdr(3)
                GlobalResources.prc4 = rdr(4)
                GlobalResources.prc5 = rdr(5)
                GlobalResources.itemCost = rdr(6)
                GlobalResources.frtCost = rdr(7)
                GlobalResources.udCost1 = rdr(8)
                GlobalResources.udCost2 = rdr(9)
                GlobalResources.avgCost = rdr(10)
                GlobalResources.clsfic = rdr(11)
                GlobalResources.vndrNo = rdr(12)
                GlobalResources.altvndrNo = rdr(13)
                GlobalResources.lotSerlShadeOut = rdr(14)
                GlobalResources.taxItem = rdr(15)
                GlobalResources.reqDep = rdr(16)
                GlobalResources.depPcnt = rdr(17)
                GlobalResources.commPcnt = rdr(18)
            Loop
            rdr.Close()
            con.Close()

Good luck to you!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.