473,748 Members | 7,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL Connecting Problems

A simple app I quickly wrote to try getting info from a database. Here
is the first part of its code. The rest of the code is irellevant.
using System;
using System.Data;
using System.Data.Sql Client;
using System.Threadin g;

namespace TestSQL
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
// Make SQL connection
Console.WriteLi ne("Connecting to SQL database
server...");
SqlConnection conn = new SqlConnection(" CONNECT TIMEOUT=2;
SERVER=localhos t; DATABASE=doomco nnector; USER ID=codeimp;
PASSWORD=###### ###; ENCRYPT=false; POOLING=false;" );
try { conn.Open(); }
catch(SqlExcept ion e)
{
Console.WriteLi ne("ERROR " + e.Number + ":
" + e.Message);
}
...
The output of this code:[quote:5608abe1e 3]Connecting to SQL database
server...
ERROR 11: General network error. Check your network
documentation.[/quote:5608abe1e 3]
Im using Windows 2000 Pro (completely up-to-date according to
www.windowsupdate.com).

I have installed the MySQL windows server on localhost and changed the
passwords as well as creating that "codeimp" account with all
privileges. I can login to that using the mysql console application
and perform operations without problems.

I have installed MDAC 2.8, no problems.

Using the Data Sources (ODBC) from the control panel, I am unable to
add a User DSN with the same settings (gives me the same error). I
have tried many different settings down to the most stupid things
like trying 127.0.0.1 instead of 'localhost', but nothing got any
better.

My network is fine and its on localhost so that shouldnt matter.
TCP/IP protocols installed and work fine as you can see, because I
can make this post.

I read some KB articles that talk about errors with this description
but they did not apply to my problem here.

What could this be? What should I do now? Help me please :)

Nov 16 '05 #1
4 1799

"CodeImp" <gh*******@hotm ail-dot-com.no-spam.invalid> wrote in message
news:41******** **@Usenet.com.. .
A simple app I quickly wrote to try getting info from a database. Here
is the first part of its code. The rest of the code is irellevant.
using System;
using System.Data;
using System.Data.Sql Client; .. . . I have installed the MySQL windows server on localhost and changed the
passwords as well as creating that "codeimp" account with all


.. . .

System.Data.Sql Client is the provider for Microsoft Sql Server.

David
Nov 16 '05 #2
SqlClient is for Microsoft Sql Server Server only.

To connect to MySQL take a look at the following information
http://www.devhood.com/tutorials/tut...utorial_id=576
"CodeImp" <gh*******@hotm ail-dot-com.no-spam.invalid> wrote in message
news:41******** **@Usenet.com.. .
A simple app I quickly wrote to try getting info from a database. Here
is the first part of its code. The rest of the code is irellevant.
using System;
using System.Data;
using System.Data.Sql Client;
using System.Threadin g;

namespace TestSQL
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
// Make SQL connection
Console.WriteLi ne("Connecting to SQL database
server...");
SqlConnection conn = new SqlConnection(" CONNECT TIMEOUT=2;
SERVER=localhos t; DATABASE=doomco nnector; USER ID=codeimp;
PASSWORD=###### ###; ENCRYPT=false; POOLING=false;" );
try { conn.Open(); }
catch(SqlExcept ion e)
{
Console.WriteLi ne("ERROR " + e.Number + ":
" + e.Message);
}
...
The output of this code:[quote:5608abe1e 3]Connecting to SQL database
server...
ERROR 11: General network error. Check your network
documentation.[/quote:5608abe1e 3]
Im using Windows 2000 Pro (completely up-to-date according to
www.windowsupdate.com).

I have installed the MySQL windows server on localhost and changed the
passwords as well as creating that "codeimp" account with all
privileges. I can login to that using the mysql console application
and perform operations without problems.

I have installed MDAC 2.8, no problems.

Using the Data Sources (ODBC) from the control panel, I am unable to
add a User DSN with the same settings (gives me the same error). I
have tried many different settings down to the most stupid things
like trying 127.0.0.1 instead of 'localhost', but nothing got any
better.

My network is fine and its on localhost so that shouldnt matter.
TCP/IP protocols installed and work fine as you can see, because I
can make this post.

I read some KB articles that talk about errors with this description
but they did not apply to my problem here.

What could this be? What should I do now? Help me please :)

Nov 16 '05 #3
Ah thanks,.. so the server you use matters. I thought SQL is a query
language that many servers support in the same way. Bah, I guess
doing it through ODBC makes it a windows-only application, no?

Nov 16 '05 #4
"CodeImp" <gh*******@hotm ail-dot-com.no-spam.invalid> wrote in message
news:41******** @Usenet.com...
I thought SQL is a query language that many servers support in the same way.

It certainly is and, once you've made a connection to the particular
SQL-compliant RDBMS in question, you should be able to query it with
"standard" SQL. But you need to be able to make that connection in the first
place!
Bah, I guess doing it through ODBC makes it a windows-only application,

no?

No need to use ODBC any more - lots of RDBMS (including mySQL) provide
native .NET providers these days and, for those which don't, there is a very
good chance that an OleDb provider will exist.

This page will be of some help: http://www.connectionstrings.com/ It
describes where you can obtain native .NET providers for mySQL, including a
free one, and also documents how to construct your connection strings.
Nov 16 '05 #5

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

Similar topics

2
1727
by: bigoxygen | last post by:
Hi. I am experiencing problems connecting to MSSQL. I'm not sure where to begin looking for the problem. I don't know if the problem is originating with PHP or MSSQL What should the host name be? When I mouse over MSSQL manager it says "\\S-CIS-0042" $db_host='local'; //IP/host of the database server
0
2062
by: maddunr | last post by:
Hi, I just installed PHP 4.3.9, MySQL 4.0.2 and PHPMyAdmin 2.6.0-pl3 on our intranet server (Win2k3 running IIS). I also have a similar setup on my local machine (http://localhost/phpmyadmin). Everything seems normal when I work on the server machine (also known as web-nt with IP xxx.xxx.xx.xx), but when I try connecting to the MySQL database on the server from my local machine (http://web-nt/phpmyadmin), two things happen:
4
1429
by: JA | last post by:
Hi, I am total newbie to SQL Server. My new host tells me I can connect through AccessXP or 2002. I have Access 2000. Can I not connect with that also? Thanks, JA
1
2521
by: Dishaa V | last post by:
Hello I need to connect to an access db which is on the internet. I do know that URL of the same. its http://www.vallury.com/balance/bank.mdb. Its just a test db. How can I connect to that db from either my desktop application or from my intranet website. Thanks and Regards
12
2789
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed both the iis and sql server in a single machine. Not too long ago, the machine had some hardware problems, and management has decided to purchase new servers, for both asp.net and sql server.
3
2243
by: Jeremy Dillinger | last post by:
I am trying to design a program that will use data from a MySQL database. Currently all the data is being used with PHP scripts from a website. I am also trying to build a software solution that can use the same data. I have gone through all the data connectors in Visual Basic.net and none of them have the options for connecting to MySQL. Does anybody know how I would go about doing this? Thanks in advance! Jeremy
5
2482
by: Odd Bjørn Andersen | last post by:
I have installed DB2 9 Enterprise Edition on my laptop and created the sample database. Now I'm having truble connecting to the database from Command Editor. If I connect from Command Window it's no problem connecting to sample (or any other databases - local or remote), but if I try to connect from Command Editor I'm not able to do that. There is no error message, the Progress dialog just run and run without anything happening. Is this...
0
1542
by: schosch | last post by:
Hello @all, we're connecting from a DB2UDB V7 on Windows to a DB2UDB on AIX. We had no problems while the version on AIX was still V7, but after wie updated the AIX-Part to V8.1 FP13 we cannot coonect any longer. When we try to connect, wie got a SQL1204 with Codepage "-469499904" and/or Regioncode "49" and SQLSTATE 22522. When we're connecting from a DB2UDBV8-Installation on Windows, we have no problems. Is there any way, to...
0
2604
by: =?Utf-8?B?QWxwZXIgQUtDQVlPWg==?= | last post by:
Hello, First of all I wish you a good day. My help request is about .NET asynchrounus socket communication. I have developed Server-Client Windows Forms .NET applications in VC++ .NET v2003. I have several problems re-establishin connection between peers. Below are my problem cases after closing of the first successfull communication; #1) I re-start the Server to accept connection requests. While it is waiting, I run the Client. It is...
0
8991
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
8830
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
9541
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...
1
9321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8242
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
6796
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
6074
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
4602
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2215
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.