473,322 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Visual Studio C# Express - MySQL

Hi

Is it possible to get Visual Studio C# Express (beta 2) connecting to a
MySQL database?

TIA
Iain
Mar 27 '06 #1
10 16422
Iain,

Unfortunatly you cannot visually connect to MySQL through C# Express, i dont
know why, i think this is just one of the limitations of C# Express.

However, you can use ODBC to connect to MySQL through code, so long as you
know the ODBC Connection string to use. Please have a look at the following
code snippet.
using System.Data.Odbc;
using System.Data;

private void GetDataFromMySQL()
{
string connStr = "";

// i am not sure what the connection string for MySql would be, i think it
might "Provider=MySQLProv;Data Source=mydb;User
Id=UserName;Password=asdasd;"
using (OdbcConnection odbcCon = new OdbcConnection(connStr))
using (OdbcCommand odbcCom = new OdbcCommand("Select * From Product",
odbcCon))
using (OdbcDataAdapter odbcDA = new OdbcDataAdapter(odbcCom))
using (DataSet ds = new DataSet())
{
odbcCon.Open();
odbcDA.Fill(ds);
/** Now that we have it in a DataSet, we can do what you want with it: f
your controls...
**/
this.dataGridView1.DataSource = ds.Tables[0];
}

}

Hope this helps

Regards

Scott Blood

C# Developer

"Iain" <te**@test.co.uk> wrote in message
news:eF****************@TK2MSFTNGP09.phx.gbl...
Hi

Is it possible to get Visual Studio C# Express (beta 2) connecting to a
MySQL database?

TIA
Iain

Mar 27 '06 #2
MySQL actually have a .net data provider, you could consider this over ODBC.

"scott blood" <sc*********@hotmail.com> wrote in message
news:O%***************@TK2MSFTNGP10.phx.gbl...
Iain,

Unfortunatly you cannot visually connect to MySQL through C# Express, i
dont know why, i think this is just one of the limitations of C# Express.

However, you can use ODBC to connect to MySQL through code, so long as you
know the ODBC Connection string to use. Please have a look at the
following code snippet.
using System.Data.Odbc;
using System.Data;

private void GetDataFromMySQL()
{
string connStr = "";

// i am not sure what the connection string for MySql would be, i think it
might "Provider=MySQLProv;Data Source=mydb;User
Id=UserName;Password=asdasd;"
using (OdbcConnection odbcCon = new OdbcConnection(connStr))
using (OdbcCommand odbcCom = new OdbcCommand("Select * From Product",
odbcCon))
using (OdbcDataAdapter odbcDA = new OdbcDataAdapter(odbcCom))
using (DataSet ds = new DataSet())
{
odbcCon.Open();
odbcDA.Fill(ds);
/** Now that we have it in a DataSet, we can do what you want with it:
f your controls...
**/
this.dataGridView1.DataSource = ds.Tables[0];
}

}

Hope this helps

Regards

Scott Blood

C# Developer

"Iain" <te**@test.co.uk> wrote in message
news:eF****************@TK2MSFTNGP09.phx.gbl...
Hi

Is it possible to get Visual Studio C# Express (beta 2) connecting to a
MySQL database?

TIA
Iain


Mar 27 '06 #3
"scott blood" <sc*********@hotmail.com> wrote in message
news:O%***************@TK2MSFTNGP10.phx.gbl...
However, you can use ODBC to connect to MySQL through code


Yes you can, but why on earth would you want to use ODBC (or even OleDB)
when MySQL provide an excellent native .NET data provider...?

http://dev.mysql.com/downloads/connector/net/1.0.html
Mar 27 '06 #4
Mark,

The question never specified a type of connection required, so i assumed
ODBC as this does not require third party .net providers which may or may
not be supported in C# Express. All that is required is the ODBC driver.

Plus the use of ODBC enables you with little or no changes to your code,
other than the provider, to change your data server or file quite quickly,
where as the likes of SqlClient is specifically for Sql Server and is a lot
of work chaning this to another server type.

Regards
Scott Blood
C# Developer

"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:uR**************@TK2MSFTNGP10.phx.gbl...
"scott blood" <sc*********@hotmail.com> wrote in message
news:O%***************@TK2MSFTNGP10.phx.gbl...
However, you can use ODBC to connect to MySQL through code


Yes you can, but why on earth would you want to use ODBC (or even OleDB)
when MySQL provide an excellent native .NET data provider...?

http://dev.mysql.com/downloads/connector/net/1.0.html

Mar 27 '06 #5
Check out
http://dev.mysql.com/tech-resources/...net/index.html :
The ODBC.NET Solution - MyODBC Driver
Using MySQL Native .NET Providers
Using the OLEDB.NET Solution - MyOLDDB Provider

Mar 27 '06 #6
If the .NET MySql Provider is well - written, it will have registration file
to register the type for designer visibility. Then the provider will appear
in the list of connection types.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Iain" wrote:
Hi

Is it possible to get Visual Studio C# Express (beta 2) connecting to a
MySQL database?

TIA
Iain

Mar 27 '06 #7
Peter,

I have just had a look at it myself and it is quite well written actually,
but , i though visual c# express didnt support visual designers for third
party dataa providers????? If it does then why cant every just download
visual c# express and start developing with that and then pay the small
license fee for the proffesional version only if your happy with what you
will be distributing.

Regards
Scott Blood
C# Developer

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:C8**********************************@microsof t.com...
If the .NET MySql Provider is well - written, it will have registration
file
to register the type for designer visibility. Then the provider will
appear
in the list of connection types.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Iain" wrote:
Hi

Is it possible to get Visual Studio C# Express (beta 2) connecting to a
MySQL database?

TIA
Iain

Mar 27 '06 #8
Scott,
you are correct it appears to be a built-in limitation of the Express
product. Well, fair-is-fair I guess. After all, it doesn't cost anything...
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"scott blood" wrote:
Peter,

I have just had a look at it myself and it is quite well written actually,
but , i though visual c# express didnt support visual designers for third
party dataa providers????? If it does then why cant every just download
visual c# express and start developing with that and then pay the small
license fee for the proffesional version only if your happy with what you
will be distributing.

Regards
Scott Blood
C# Developer

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:C8**********************************@microsof t.com...
If the .NET MySql Provider is well - written, it will have registration
file
to register the type for designer visibility. Then the provider will
appear
in the list of connection types.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Iain" wrote:
Hi

Is it possible to get Visual Studio C# Express (beta 2) connecting to a
MySQL database?

TIA
Iain


Mar 27 '06 #9
Which brings brings me back to my origonal post, use ODBC this is fully
supported.

Regards
Scott Blood
C# Developer

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:22**********************************@microsof t.com...
Scott,
you are correct it appears to be a built-in limitation of the Express
product. Well, fair-is-fair I guess. After all, it doesn't cost
anything...
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"scott blood" wrote:
Peter,

I have just had a look at it myself and it is quite well written
actually,
but , i though visual c# express didnt support visual designers for third
party dataa providers????? If it does then why cant every just download
visual c# express and start developing with that and then pay the small
license fee for the proffesional version only if your happy with what you
will be distributing.

Regards
Scott Blood
C# Developer

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in
message
news:C8**********************************@microsof t.com...
> If the .NET MySql Provider is well - written, it will have registration
> file
> to register the type for designer visibility. Then the provider will
> appear
> in the list of connection types.
> Peter
>
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "Iain" wrote:
>
>> Hi
>>
>> Is it possible to get Visual Studio C# Express (beta 2) connecting to
>> a
>> MySQL database?
>>
>> TIA
>> Iain
>>
>>
>>


Mar 28 '06 #10
Can you use Sql Express with c# express?

--
William Stacey [MVP]
Mar 29 '06 #11

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

Similar topics

6
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with...
26
by: Bruno Jouhier [MVP] | last post by:
I'm currently experiencing a strange phenomenon: At my Office, Visual Studio takes a very long time to compile our solution (more than 1 minute for the first project). At home, Visual Studio...
5
by: Patrick Olurotimi Ige | last post by:
Hi, I have VStudio.Net 2003 installed but can i install Visual Web Developer also on the same PC. My current .Net Frameork version is 1.1. Will the Visual Web Developer install ASP.NET 2.0? And...
4
by: Andrew Robinson | last post by:
My main dev machine has WinXp and VS2005 (pro). 1. I need to install VWD Express Edition so that I can do some instruction on this. Any issues with both on the same machine. Installation order?...
2
by: Progman | last post by:
I have Visual Studio 2005 Standard edition. Is ti the same thing as the Express edition or Standard is more?
2
by: terry.trent | last post by:
I'm new to c# and Visual C# Express, and to normal programming in general (some background in web programming), and i have a question vital to my current project. Basically, i have been asked to...
1
by: Dr T | last post by:
Hi! I downloaded MS Visual Web Developer 2005 Express Edition, MS .NET Framework SDK v2.0, and MS SQL Server 2005. Subsequently, I bought MS Visual Studio 2005 Professional Edition. 1) Are...
2
by: Cramer | last post by:
So, what is the relationship between Visual Studio and Visual Web Developer. I find a lot of documentation on MSDN that presents Visual Web Developer as it's own stand-alone product (which I'd...
6
by: Cirene | last post by:
From my experience/undertanding SQL Server (and SQL Express) is the preferred db to use with Visual Studio and is very nicely integrated with it. It works well with the built in membership, etc......
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.