Jump to content

How to connect vb 2005 with SQL Server 2005

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
Ubuntu_monster

Ubuntu_monster

    Newbie

  • Members
  • Pip
  • 7 posts
Hi every one from My country : good morning .....


Somebody help me ..

How can I connect visual vasic 2005 with Sql server 2005 manually "not with wizard" ,

What is The Correct String for The Connection statement and i need The following statements :

1 - The Command statement.
2 - The Adapter Statement .
3 - The Reader statement


-- When I write the code to connect with data base i face the Runtime error :
"InvalidOperationException"....


Some body help ....
Sorry for bad english

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
It will depend: are you doing an ADO connection, an ODBC connection, or something else?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
He said SQL Server - are there more than one type of connection for that? Forgive my ignorance, I haven't done any database work.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
There are at least three ways to connect that I know of: ADO, ODBC, and direct (basically a telnet to the SQL Server port and issue commands based on the API). Each connection type requires different configuration methods.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
Ubuntu_monster

Ubuntu_monster

    Newbie

  • Members
  • Pip
  • 7 posts

WingedPanther said:

There are at least three ways to connect that I know of: ADO, ODBC, and direct

Dear WingedPanther :

I need to connect it with ADO
Sorry for bad english

#6
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Your connection string will resemble:
"Driver={SQL Server};Server=MyServer;Database=MyDatabase;Uid=MyLogin;Pwd=MyPassword;"
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#7
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Unless you haven't set up any user name and password credentials...
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums