in Search
     
Latest post 03-26-2007 2:01 PM by wraith. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-10-2007 1:40 AM

    • michang05
    • Top 50 Contributor
    • Joined on 01-27-2006
    • Cavite, Philippines
    • Posts 26
    • Points 415

    SQL Server 2005 question..

    ok i did the download for the vb.net cause that's the one im studying for asp.net code..

    anyway i switch from studying mysql to sql server 2005 on visual studio , because i think im using microsoft why not use the database that is integrated in vs 2005.

    but i got a problem im a novice also in sql server 2005?

    my questions would be:
    1. How to make a database in wizard using VS 2005

    2. How to make a database using hard-code

    3.What is the file that i made form the sql server is it test.mdf(example)? is this the database file?

    i actually got some self study going on but im not yet contented , maybe because i did it incorrectly?

    i made a database using wizard and yes they can read the table i made, but when i try to make it in hard-code

    it seems i can't get the connectionstring to use?
    what is it? cause i know the string only in access!

    and also i don't know what are the things that i need to install when running sql server on my pc?

    i got this error message:

    An error occured while establishing a connection to the server.When connecting to SQL Server 2005 , this failure may be caused by the fact that
    under the default settings SQL Server does not allow remote connections.(provider:Named Pipes Provider,error:40-Could not open a connection to sql server.

    thanks

    "Learning by correcting and not repeating Mistakes"
    • Post Points: 20
  • 02-11-2007 10:13 PM In reply to

    • keithrull
    • Top 10 Contributor
    • Joined on 08-08-2005
    • San Diego, CA
    • Posts 1,956
    • Points 39,255

    Re: SQL Server 2005 question..

    hmmm.. i'm abit confused with your question so i'll break it down

    1. How to make a database in wizard using VS 2005 <, Are you using SQL Server Express? or the SQL Server 2005 Standard

    2. How to make a database using hard-code << are you reffering to using SQL Scripts(CREATE DATABASE) or using SQL-SMO?

    3. What is the file that i made form the sql server is it test.mdf(example)? is this the database file? << Yes this is actually the database file.

    it seems i can't get the connectionstring to use?
    what is it? cause i know the string only in access!

    << are you sure you have the proper connection strings? connecting to a standard sql server 2005 and sql server express is different. you can read more about there from this: http://connectionstrings.com/?carrier=sqlserver2005

    An error occured while establishing a connection to the server.When connecting to SQL Server 2005 , this failure may be caused by the fact that
    under the default settings SQL Server does not allow remote connections.(provider:Named Pipes Provider,error:40-Could not open a connection to sql server.

    << have you configured SQL Server yet? SQL Server 2005 by defaut doesnt allow remote connections. You need set this feature manually. A KB about this issue can be found here: http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
     

    devpinoy sig

    • Post Points: 20
  • 02-13-2007 3:29 AM In reply to

    • michang05
    • Top 50 Contributor
    • Joined on 01-27-2006
    • Cavite, Philippines
    • Posts 26
    • Points 415

    Re: SQL Server 2005 question..

    thanks for the remote link info,

     

    by the way i did figured how to make a connection and i did made a wizard database code from sql server and its hardcode using SqlClient for the namespace..

    i used the connectionstring="Data Source=.\SQLExpress;Integrated Security=true;AttachDbFilename=|DataDirectory|\mydb.mdf;User Instance=true"

    im using visual studio 2005 and the integrated SQL Server 2005 on it!

    Can you help me find a tutorial on how to use more about Sql Server 2005 on visual studio 2005? thanks sir

    wanted to know the how to's of it!

     

    after i did have a great foundation on sql server 2005 next is asp.net !

    --------

    im really interested in the .NET thing now and i hope i can have my OJT using .NET (vb.net /asp.net) so that it will help me in my thesis more!

    "Learning by correcting and not repeating Mistakes"
    • Post Points: 20
  • 03-26-2007 2:01 PM In reply to

    • wraith
    • Top 75 Contributor
    • Joined on 03-26-2007
    • Davao City
    • Posts 15
    • Points 255

    Re: SQL Server 2005 question..

    michang05:

    1. How to make a database in wizard using VS 2005

    2. How to make a database using hard-code

    3.What is the file that i made form the sql server is it test.mdf(example)? is this the database file?

    Ans:

    1. Create database in Wizard:
    a. Go to View->Server Explorer.
    b. Right Click Data Connections and select "Create New Sql Server Database"
    c. Just follow the steps

    2. Create Database using hardcode:
    a. Create a SqlConnection object, then connect to the "master" database of your SqlServer instance.
    b. Create a SqlCommand object having the commandText set to "CREATE DATABASE <dbaseName>"
    c. Set the CurrentConnection of the Command to your newly created connection
    d. Call the ExecuteNonQuery() method of the SqlCommand

    3. Actually 2 files are created when you create a database in SqlServer. Their extesions are *.mdf and *.ldf

    If you have problems in your connection strings, try visiting http://www.connectionstrings.com

     

    cheers,

    • Post Points: 5
Page 1 of 1 (4 items)