Showing posts with label newbie. Show all posts
Showing posts with label newbie. Show all posts

Sunday, March 11, 2012

Connection to Sql-Server

Hi,

I'm a newbie at the asp.net site.
The things i have done where with access.
But now i want to use Sql-server

In access i used this to execute a query:

*** In the global.asax ***
session("dbpath") = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=" + Server.MapPath("\db\MediaProject.mdb")

*** Return dataSet ***
ResultDS = GetSql(SqlStatement, session("dbpath"))
Dim ResultDS AS system.data.dataset

*** Lib file: ***
Function GetSQL(a As string, b as string) As System.Data.DataSet
Dim connectionString As String = b
Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)
Dim queryString As String = a
Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection

Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dataAdapter.Fill(dataSet)

The question now is wich string do i now have to put in the session("dbpath") ?
Which is the Provider?
How does the string looks like.
Or do i use something else now ?

Many thanx in advance


oSQLConn.ConnectionString = "Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=mySQLServerDBName;" & _
"User ID=myUsername;" & _
"Password=myPassword"

Thursday, March 8, 2012

Connection to remote server using VPN

Hi - I am a relative newbie to setting up and configuring servers so am a
bit baffled by all the server techno-speak.
My issue - I have a client who is based about 40 miles away who want me to
do some database work for them. I am a freelancer and he is a small company
who relies on a non sql server specific moonlighter for tech support (it's
not as wing and prayer as it might seem!).
They bought MS Small Biz server which includes SQL 2000. I tried to install
it on my XPHome pc but came to the view that you need a 2000/2003 server to
run anything bigger than a 4Gb database. Given that the db will be much
bigger than 4Gb we therefore need to install SQL Server on his server and
run it as a sql server with me installing query analyser and eneterprise
manager on my PC and connect. All fine in theory. Now for security I am
assuming the best way to connect is by using VPN? If this is so, can any
one point me to any info on setting up my end + his end and what may be
required h/w + s/w etc?
His moonlight techie says I need a static IP address... I think I have a
dynamic one, and that all he need to do is set up some filters his end. I
also have a Lynksys router (BEFSR41) and Norton Proff Fiewall. He has router
and firewall his end.
I looked for past postings and find ref to this link
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad
but now it's dead.
Any help much appreciated!
Happy New Year.
Andythere is a thread going on at www.sqlservercentral.com
http://www.sqlservercentral.com/forum/link.asp?TOPIC_ID=19507
maybe that will get you on track
jobi
"Andreww" <andrew@.fake.com> wrote in message
news:kwyIb.2561$tH.23625741@.news-text.cableinet.net...
> Hi - I am a relative newbie to setting up and configuring servers so am a
> bit baffled by all the server techno-speak.
> My issue - I have a client who is based about 40 miles away who want me to
> do some database work for them. I am a freelancer and he is a small
company
> who relies on a non sql server specific moonlighter for tech support (it's
> not as wing and prayer as it might seem!).
> They bought MS Small Biz server which includes SQL 2000. I tried to
install
> it on my XPHome pc but came to the view that you need a 2000/2003 server
to
> run anything bigger than a 4Gb database. Given that the db will be much
> bigger than 4Gb we therefore need to install SQL Server on his server and
> run it as a sql server with me installing query analyser and eneterprise
> manager on my PC and connect. All fine in theory. Now for security I am
> assuming the best way to connect is by using VPN? If this is so, can any
> one point me to any info on setting up my end + his end and what may be
> required h/w + s/w etc?
> His moonlight techie says I need a static IP address... I think I have a
> dynamic one, and that all he need to do is set up some filters his end. I
> also have a Lynksys router (BEFSR41) and Norton Proff Fiewall. He has
router
> and firewall his end.
> I looked for past postings and find ref to this link
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad
> but now it's dead.
> Any help much appreciated!
> Happy New Year.
> Andy
>|||Jobi - thanks. I took a look and it seems more about how to set things up
once the VPN is set up... which helps.
In the firts instance, my question was about... is VPN the way to connect a
SQL client to server?
Help appreciated... even if it's that I'm in the wrong news group!
Regards
Andy
"jobi" <jobi@.reply2.group> wrote in message
news:bsud5v$fhp$1@.reader08.wxs.nl...
> there is a thread going on at www.sqlservercentral.com
> http://www.sqlservercentral.com/forum/link.asp?TOPIC_ID=19507
> maybe that will get you on track
> jobi
> "Andreww" <andrew@.fake.com> wrote in message
> news:kwyIb.2561$tH.23625741@.news-text.cableinet.net...
> > Hi - I am a relative newbie to setting up and configuring servers so am
a
> > bit baffled by all the server techno-speak.
> >
> > My issue - I have a client who is based about 40 miles away who want me
to
> > do some database work for them. I am a freelancer and he is a small
> company
> > who relies on a non sql server specific moonlighter for tech support
(it's
> > not as wing and prayer as it might seem!).
> >
> > They bought MS Small Biz server which includes SQL 2000. I tried to
> install
> > it on my XPHome pc but came to the view that you need a 2000/2003 server
> to
> > run anything bigger than a 4Gb database. Given that the db will be much
> > bigger than 4Gb we therefore need to install SQL Server on his server
and
> > run it as a sql server with me installing query analyser and eneterprise
> > manager on my PC and connect. All fine in theory. Now for security I am
> > assuming the best way to connect is by using VPN? If this is so, can
any
> > one point me to any info on setting up my end + his end and what may be
> > required h/w + s/w etc?
> >
> > His moonlight techie says I need a static IP address... I think I have a
> > dynamic one, and that all he need to do is set up some filters his end.
I
> > also have a Lynksys router (BEFSR41) and Norton Proff Fiewall. He has
> router
> > and firewall his end.
> >
> > I looked for past postings and find ref to this link
> >
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad
> > but now it's dead.
> >
> > Any help much appreciated!
> >
> > Happy New Year.
> >
> > Andy
> >
> >
>|||"In the firts instance, my question was about... is VPN the way to connect a
SQL client to server?"
Given what little knowledge I have about your situation, I would say that VPN is your best bet. It's going to be the most economical, practical, and easiest way to connect to your client using SQL. Anything else would be expensive and/or unsecure.
But that's just my opinion...
Hope this helps.
Shaun

Friday, February 24, 2012

connection string in vb.net

Hi guys,

I'm a newbie with .net and web development. I'm trying to create a web application using vb.net. I have SQL Server 2000 on my machine. And i connect to it without any username and password. When i tried to insert data into the database using the web application i had to first create a conenction string. So, my connection string is......

Dim strConnectionAsString = _

"Data Source=localhost;Initial Catalog=Northwind;" _

& "Integrated Security=true;"

And i get the error......

Login falied for the user.

Could someone tell me what i did wrong?? I need to get this done by tomorrow and any help would be greatly appreciated.

Thanks,
Vasantha.

(1) change your data source from localhost to local.

(2) Do you have the username ASPNET added to the Northwind database ?

Sunday, February 12, 2012

Connection Problems SQL2000 on Local Machine

This may be a stupid newbie question, but being that I'm not a DBA I'm going to ask it anyway.

We discovered a problem with a clients server (Windows 2003 SBS) when we tried to install Veritas Backup Exec. Backup Exec requires an instance of either SQLMSDE or full SQL. This server has full SQL 2000 sp3a installed on it with a working account application. When backup exec trys to create it's instance it fails.

Investigating further...when I go into Enterprise Manager (logged in as Domain Admin) I get an error when I select the local server.

I.E.
"A connection could not be established to (LOCAL).
Reason: Data source name not found and no default driver specified.
Please verify SQL Server is running and check your SQL Server registration properties. blah blah blah.

Okay the server is running. The accounting application (client/server) is still working. I right click on the server and select "New Server Registration" for the field "server" I click the browse button and the "Active Servers" box is empty..:shocked:

I went to check the "Data Sources" under drivers, that field is blank. (no drivers installed). I downloaded MS's component checker and it says "MDAC 2.8 on Windows server 2003 sp1" is installed.

At this point I have exhausted my knowledge of MS-SQL server. My goal is to get BackupExec installed and NOT break the existing accounting application.

Any help is greatly appreciated.

Thanks
rogerbHi there,

i think the running instance on your server was not installed with the "Mixed Mode" authentication.
That's where the external application trying to connect on windows login account fials.

Hope this helps.

Regards.|||I think I've determined that there is a named instance of SQL running, but that the default instance is NOT running. How do I start the default instance and not mess up the named instance that is running? I tried "sqlservr.exe" at the command prompt but received a number of errors regard the log files being locked by another process?

Edit: Nope, my last statement is wrong there. There are two instances running. Which would explain the logfile errors. But...I still can't connect to the server with Enterprise Manger.

Edit 2: The authentication mode on the named instance was set to 2 (mixed), the default 1(windows), I set the default to 2 and restarted the service. I still can't connect with Enterprise Manager.|||Okay I fixed my own problem. Here's what I found. In the registry under HKLM\Software\ODBC there is an entry "odbcinst.ini". There are suppose to be a list of installed drivers here. In my case this key was empty. So I created the SQL Server key and the Text value"Driver" which equals, "c:\winnt\system32\sqlsrv32.dll.

And...I can get into the default instance now.