473,748 Members | 2,502 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connection problems

Hi,

I just install MSDE 2000 on my computer and I am trying to make a connection
with the server but it does not seem to be working. What am I doing wrong in
the code below? When I open my Server Explorer I see Data Connections and
Servers. Do I have to make a physical connection of some sort first? In the
Servers section, I see that it automatically created a SQL server by the
name REBORN where I created a database called royDB. Am I using the wrong
parameters below for the connections string:

string strConnection = "server=(local) \\REBORN;" +

"uid=QSUser;pwd =QSPassword;" +

"database=royDB ";
Here is my code below.
TIA
Roy

using System;

using System.Data;

using System.Data.Sql Client;

using System.Data.Sql Types;

namespace testing

{

/// <summary>

/// Summary description for Class1.

/// </summary>

class Class1

{

/// <summary>

/// The main entry point for the application.

/// </summary>

[STAThread]

static void Main(string[] args)

{

//Program Files\\Miscroso ft SQL Server\\MSSQL\\ Data;" +

string strConnection = "server=(local) \\REBORN;" +

"uid=QSUser;pwd =QSPassword;" +

"database=royDB ";

SqlConnection conn = new SqlConnection(s trConnection);
conn.Open();
conn.Close();
}

}

}
Nov 17 '05 #1
4 1248
server=(local)

or

server=REBORN

The server is the local server. It also happens to be called "REBORN".

I think that should fix it.

Pete

"Roy Gourgi" <ro***@videotro n.ca> wrote in message
news:62******** *******@weber.v ideotron.net...
Hi,

I just install MSDE 2000 on my computer and I am trying to make a
connection with the server but it does not seem to be working. What am I
doing wrong in the code below? When I open my Server Explorer I see Data
Connections and Servers. Do I have to make a physical connection of some
sort first? In the Servers section, I see that it automatically created a
SQL server by the name REBORN where I created a database called royDB. Am
I using the wrong parameters below for the connections string:

string strConnection = "server=(local) \\REBORN;" +

"uid=QSUser;pwd =QSPassword;" +

"database=royDB ";
Here is my code below.
TIA
Roy

using System;

using System.Data;

using System.Data.Sql Client;

using System.Data.Sql Types;

namespace testing

{

/// <summary>

/// Summary description for Class1.

/// </summary>

class Class1

{

/// <summary>

/// The main entry point for the application.

/// </summary>

[STAThread]

static void Main(string[] args)

{

//Program Files\\Miscroso ft SQL Server\\MSSQL\\ Data;" +

string strConnection = "server=(local) \\REBORN;" +

"uid=QSUser;pwd =QSPassword;" +

"database=royDB ";

SqlConnection conn = new SqlConnection(s trConnection);
conn.Open();
conn.Close();
}

}

}

Nov 17 '05 #2
Hi Pete,

I tried that and it did not work, but I found the problem. Strangely enough
when I changed my connection string to the following it worked. If I remove
the Integrated Security from this string, it all will not work. Do you know
why by any chance.

strConnection = "Server=(local) ;Integrated Security=yes;da tabase=royDB";

Thanks
Roy

"Pete Davis" <pdavis68@[nospam]hotmail.com> wrote in message
news:BK******** *************** *******@giganew s.com...
server=(local)

or

server=REBORN

The server is the local server. It also happens to be called "REBORN".

I think that should fix it.

Pete

"Roy Gourgi" <ro***@videotro n.ca> wrote in message
news:62******** *******@weber.v ideotron.net...
Hi,

I just install MSDE 2000 on my computer and I am trying to make a
connection with the server but it does not seem to be working. What am I
doing wrong in the code below? When I open my Server Explorer I see Data
Connections and Servers. Do I have to make a physical connection of some
sort first? In the Servers section, I see that it automatically created a
SQL server by the name REBORN where I created a database called royDB. Am
I using the wrong parameters below for the connections string:

string strConnection = "server=(local) \\REBORN;" +

"uid=QSUser;pwd =QSPassword;" +

"database=royDB ";
Here is my code below.
TIA
Roy

using System;

using System.Data;

using System.Data.Sql Client;

using System.Data.Sql Types;

namespace testing

{

/// <summary>

/// Summary description for Class1.

/// </summary>

class Class1

{

/// <summary>

/// The main entry point for the application.

/// </summary>

[STAThread]

static void Main(string[] args)

{

//Program Files\\Miscroso ft SQL Server\\MSSQL\\ Data;" +

string strConnection = "server=(local) \\REBORN;" +

"uid=QSUser;pwd =QSPassword;" +

"database=royDB ";

SqlConnection conn = new SqlConnection(s trConnection);
conn.Open();
conn.Close();
}

}

}


Nov 17 '05 #3
Ah,

I hadn't thought of that. The uid and pwd are used for SQL security, which
isn't the default in MSDE. The default is integrated security. SQL Security
isn't very "secure" as it passes the plaintext userid and password across
the wire, wherease integrated security uses NT security and is much more
secure.

Pete

"Roy Gourgi" <ro***@videotro n.ca> wrote in message
news:8t******** ********@weber. videotron.net.. .
Hi Pete,

I tried that and it did not work, but I found the problem. Strangely
enough when I changed my connection string to the following it worked. If
I remove the Integrated Security from this string, it all will not work.
Do you know why by any chance.

strConnection = "Server=(local) ;Integrated Security=yes;da tabase=royDB";

Thanks
Roy

"Pete Davis" <pdavis68@[nospam]hotmail.com> wrote in message
news:BK******** *************** *******@giganew s.com...
server=(local)

or

server=REBORN

The server is the local server. It also happens to be called "REBORN".

I think that should fix it.

Pete

"Roy Gourgi" <ro***@videotro n.ca> wrote in message
news:62******** *******@weber.v ideotron.net...
Hi,

I just install MSDE 2000 on my computer and I am trying to make a
connection with the server but it does not seem to be working. What am I
doing wrong in the code below? When I open my Server Explorer I see Data
Connections and Servers. Do I have to make a physical connection of some
sort first? In the Servers section, I see that it automatically created
a SQL server by the name REBORN where I created a database called royDB.
Am I using the wrong parameters below for the connections string:

string strConnection = "server=(local) \\REBORN;" +

"uid=QSUser;pwd =QSPassword;" +

"database=royDB ";
Here is my code below.
TIA
Roy

using System;

using System.Data;

using System.Data.Sql Client;

using System.Data.Sql Types;

namespace testing

{

/// <summary>

/// Summary description for Class1.

/// </summary>

class Class1

{

/// <summary>

/// The main entry point for the application.

/// </summary>

[STAThread]

static void Main(string[] args)

{

//Program Files\\Miscroso ft SQL Server\\MSSQL\\ Data;" +

string strConnection = "server=(local) \\REBORN;" +

"uid=QSUser;pwd =QSPassword;" +

"database=royDB ";

SqlConnection conn = new SqlConnection(s trConnection);
conn.Open();
conn.Close();
}

}

}



Nov 17 '05 #4
Um... I think I have got that to work with userid and password, but the
userid was passed as "user=", not "uid="

"Pete Davis" <pdavis68@[nospam]hotmail.com> wrote in message
news:_d******** *************** *******@giganew s.com...
Ah,

I hadn't thought of that. The uid and pwd are used for SQL security, which
isn't the default in MSDE. The default is integrated security. SQL Security isn't very "secure" as it passes the plaintext userid and password across
the wire, wherease integrated security uses NT security and is much more
secure.

Pete

"Roy Gourgi" <ro***@videotro n.ca> wrote in message
news:8t******** ********@weber. videotron.net.. .
Hi Pete,

I tried that and it did not work, but I found the problem. Strangely
enough when I changed my connection string to the following it worked. If I remove the Integrated Security from this string, it all will not work.
Do you know why by any chance.

strConnection = "Server=(local) ;Integrated Security=yes;da tabase=royDB";

Thanks
Roy

"Pete Davis" <pdavis68@[nospam]hotmail.com> wrote in message
news:BK******** *************** *******@giganew s.com...
server=(local)

or

server=REBORN

The server is the local server. It also happens to be called "REBORN".

I think that should fix it.

Pete

"Roy Gourgi" <ro***@videotro n.ca> wrote in message
news:62******** *******@weber.v ideotron.net...
Hi,

I just install MSDE 2000 on my computer and I am trying to make a
connection with the server but it does not seem to be working. What am I doing wrong in the code below? When I open my Server Explorer I see Data Connections and Servers. Do I have to make a physical connection of some sort first? In the Servers section, I see that it automatically created a SQL server by the name REBORN where I created a database called royDB. Am I using the wrong parameters below for the connections string:

string strConnection = "server=(local) \\REBORN;" +

"uid=QSUser;pwd =QSPassword;" +

"database=royDB ";
Here is my code below.
TIA
Roy

using System;

using System.Data;

using System.Data.Sql Client;

using System.Data.Sql Types;

namespace testing

{

/// <summary>

/// Summary description for Class1.

/// </summary>

class Class1

{

/// <summary>

/// The main entry point for the application.

/// </summary>

[STAThread]

static void Main(string[] args)

{

//Program Files\\Miscroso ft SQL Server\\MSSQL\\ Data;" +

string strConnection = "server=(local) \\REBORN;" +

"uid=QSUser;pwd =QSPassword;" +

"database=royDB ";

SqlConnection conn = new SqlConnection(s trConnection);
conn.Open();
conn.Close();
}

}

}



Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4718
by: Cliff Cooley | last post by:
Can anybody suggest what may be causing the following problem ? I have an ASP script that opens a connection to an Oracle database using a DSN connection string, such as : Set dbConn= Server.CreateObject("ADODB.Connection") dbConn.Open "DSN=somedsn; UID=someuser; PWD=somepassword" With the ASP running on an IIS 5 server, using the Oracle 8 driver to connect to an Oracle 9 database, there are no connection problems, and
8
12114
by: Peter Larsson | last post by:
Hi there, I've recently developed a VBA-program in Excel that fetches and presents data from a distant Access database over a wireless peer-to-peer network (both computers running Win XP Pro). It has worked relatively well for some time, but recently I'm often encountering errors when trying to fetch the data. I am pretty sure that this is because of a poor wireless connection since I'm also having some problems e.g. copying files...
9
17029
by: mcbill20 | last post by:
Hello all. I just installed Oracle 10g developer tools on a machine running XP Pro and Office XP. Before this I had just the Oracle 9 client installed. I the previous configuration, I was able to access any of the Oracle tables on another machine but now I am having problems. Unfortunately, I don't remember the correct syntax for the ODBC connect string and I am hoping that is my whole problem. I am trying to connect to an Oracle 9...
2
2456
by: Jim Heavey | last post by:
How do I set up a Connection Pool? How can I look on the server and see how many connections are being used by my application? I am pretty sure that my application must be leaving connections open, because I begin to receive error message indicating that the system can not open a connection and I should check my connection pool, with me being the only one on the server, this should not really be a problem. I am not sure why I do not...
10
2512
by: Daniel Fernandes | last post by:
Hi there Let's say due to several reasons I have an ASP.Net application that has a database access class that stores a database connection in a shared member : public class dataaccess private shared DB as System.Data.SqlClient.SqlConnection
7
2942
by: mfeingold | last post by:
I am working on a system, which among other things includes a server and a ..net control sitting in an html page and connected to the server. I ran into a couple of problems, you guys might have some insight about. 1) It takes 20 sec or so to open a tcp socket from the client to the server. It just sits in the TcpClient.conect waiting for something. When I run the same control from a windows application it connects right away and works...
26
16519
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On Win2K3/IIS6.0), do we still need this patch? 2) Does it specifically solve only this error: The underlying connection was closed. An unexpected error
4
14633
by: Susan Baker | last post by:
PHP Newbie here - I apologize if any of my questions appear daft or obvious ... Does PHP (or maybe the web server - Apache in my case), support (database) connection pooling?. It seems terribly inefficient if every request for data wil incurr the overhead of creating a connection to the db. While on the subject of pooling - does any one know (when using PHP in "server side scripting") if scripts are launched as seperate processes
17
2380
by: Alan Silver | last post by:
Hello, I have a generic method in a utility class that grabs an sqldatareader and returns it. Due to the fact that (AFAIK), you can't close the database connection before you've read the data, this method doesn't close it, it just returns the datareader. The calling code uses the datareader and then just lets it drop out of scope, to be picked up by the garbage collector. Is this a problem? A friend of mine suggested to me that not...
4
8288
by: Fred Zuckerman | last post by:
I have a A2K database that includes some linked tables (these links are SQL views). Sometimes there are "issues" with the SQL server and the users receive a timeout error whenever they try to access those records. The timeout error occurs after 60 seconds. Many times the user has given up and used ctrl-alt-del to end task thinking their computer has locked up. I suppose I could change the default timeout from 60 seconds down to 30...
0
8987
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9534
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8239
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2211
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.