.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

mysql and vb.net connection

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net

Dear All,

May I ask the following questions?

1.  How can I connect mysql to vb.net and showing it for example on a gridview?

2.  How can I use membership roles and username then linking it on my database?  Ex.  If i have employees table it should have link the username and password on the aspdbnet table?  Thanks. 

View Complete Post

More Related Resource Links

Connection Problem with mysql and asp.net

i'm using this string to connect with mysql and asp.net but still agot the connection problem. the connection is not going to open............. i got the following error....... ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified please help me come from this problem "DRIVER={MySQL ODBC 3.51 Driver};DSN=sql4;SERVER=;DATABASE=myppw; UID=kraft; PASSWORD=myka; OPTION=3"

MySQL connection class

I have a class to connect to a MySQL database, execute a stored procedure and close the connection. In an application that is giving some performance problems I have the following code:                 public void execute_NonQuery_procedure(string StoredProcedure, Hashtable hParams)                {                    MySqlConnection oConnection = new MySqlConnection();                     try                    {                        //***** Ontenemos la cadena de conexión *****//                        string sConnection = ConfigurationManager.AppSettings[DB];                        oConnection = new MyS

mysql connection erorr


hey i did a web app for my friend and used sql 2008 to build and debug

after i finished i did a mysql database

and uploaded the files to my hosting

this is what i write in my web.config but i get a message saying cannot establish connection or smt like that

any help would be nice or suggestions

  <add name="MasterComputersConnectionString" connectionString="Server=localhost;Database=master-pc_co_il_mastercomputers;Uid=maste_yair;Pwd=daniela192;" providerName="MySql.Data.MySqlClient"/>


Connection pooling issue with microsoft enterprise library in mysql


I am using microsoft enterprise libarary to connect to mysql using mysql .net connector (latest version 6.2.3)

But i am facing a problem of too many connections and connection pool reached maximum limit issue.

As connection is disposed by enterprise library iteself so i dont close the connection anywhere.

So after two or three hours i found i have 100 mysql connections in sleep mode which are doing nothing and are not being reused from the code .

So i want to ask is there any issue with my code or is there any issue with mysql connector

please suggest me a solution so that i can rectify this issue as it is causing a lot of trouble to me.


Ajay Singh Beniwal

Mysql C# connection failure


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)

    protected void btnUpload_Click(object sender, EventArgs e)
        string strImageName = txtName.Text.ToString();
        if (FileUpload1.PostedFile != null && FileUpload1.PostedFile.FileName != "")
            byte[] imageSize = new byte[FileUpload1.PostedFile.ContentLength];
            HttpPostedFile uploadedImage = FileUpload1.PostedFile;
            uploadedImage.InputStream.Read(imageSize, 0, (int)FileUpload1.PostedFile.ContentLength);


SQL Connection String

We can learn or know how can we connect the database from our .net. This will help for freshers or .NET beginners!

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.

connection string question from a newbie


when publishing  in the webmatrix dialogue it asks for "destination connection string" for my "database.mdf"

I was not sure what it was so I pasted this from my web.config file :

Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\database.mdf;Integrated Security=True;User Instance=True

it all published ok, but wont run, so I guess it has somthing to do with this connection string or some kind of configuration issue.

My question is this, What should go in the field for "Destination connection string"

localhost is not set up to establish a connection on port 51624 with this computer


I'm trying to run asp.net locally, but getting the error

localhost is not set up to establish a connection on port 51624 with this computer

How can I fix it?

connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly.


I dont have the SQL EXPRESS installed instead I have SQL Standard Edition.

 I have two SQL Server instances installed.

 1- UserLT (this is sql 2000)
2- UserLT\SQL2005 (this is SQL 2005 named instance)

But when i try to add a database to my VS website project I get the following error:

Connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly. please verify the installation of the component or download from the URL: go.microsoft.com/fwlink/?linkId=4925

I went in Tools>Opetions>DataBase tools>Data Connection>Sql Server Instance Name (blank for default)

and changed the "SQLEXPRESS" to "USERLT\SQL2005".

But I still get the same error message. Any ideas how i can resolve this issue?

Unable to make connection to database?


Hy guys. I try to connect my database for so long so i wrote two type of codes. Let's discuse first on.

I have database called PhoneDirectory.

It have only one table named Residents.

I have button wiht ID="Button1".

I want when i click this button to see all of my residents. 

I want to see the result in DetailsView and to be able to edin, delete and add new resident.

First try with SqlDataSource so i wrote this:

<asp:SqlDataSource ID="Resident Details" runat="server" ProviderName="System.Data.SqlClient" ConnectionStrings="<%$ ConnectionStrings:ThisIsTheConnection%>" 
              SelectCommand = "SELECT * FROM Resident "

Individual field - MySQL



I was wondering how to recieve an individual field from my MySQL database.

I have been able to get a row, but what I am trying to do is get a name from my database and set it into the HeaderText in my DataGrid.

The way I am trying to do it at the moment is

using (OdbcCommand cmd = new OdbcCommand(formQuery, con))
                formDataGrid.Columns[0].HeaderText = cmd.ExecuteReader(
                    CommandBehavior.CloseConnection |

This doesn't seem to get a value from the GetValue, but if use

using (OdbcCommand cmd = new OdbcCommand(formQuery, con))
                formDataGrid.DataSource = cmd.ExecuteReader(
                    CommandBehavior.CloseConnection |

it will bind my data into the grid.

I just want to be able to change the HeaderText in the first coulmn of the DataGrid from one table and have the DataGrid be filled from another table.

I can fill the DataGrid its just changing the HeaderText that I am having trouble with.

Any help?

search in mysql database, mvc



I have set up a mysql connection in visual studio 2010 and now i have a connection and dont really know where to go next.

I want to be able to search the data and get the result in a view.

using asp.net mvc

Using LINQ and MySQL


Hi. I am wondering if its possible to use LINQ and MySQL?

I am build as .NET MVC, i have set up my MySQL connection and want to retrive the data and display it in a view, how is this done?

Can i use LINQ or something else or should dont use it at all.

// Thanks

Saving textbox data to MySql database in asp.net


Hi dear coders

though a very simple question to ask, but please tell me how to save and retrieve data in/from my textboxes to/from database (MYSQL) on submit button click.

i know its a very simple task but i cant make it done, so i request you to please send me some working example link or post any helpful code here in asp.net

i will be highly thankful for any kind help from you geniuses.



Need Oracle Data Provider .CS File for Oracle 10g Database connection !



I need a 'Wrapper.cs' file which takes care of the Database connection ( Oracle 10g) where

i can just call the method with my SQL Query


Gridview1.DataSource = SampleWrapper.ExecuteDatatable("THE SQL QUERY");


Plz Post the link if there is any open source !    

MySql.Data assembly problem



I added refernece MySql.Data to my project. My web.config looks like that:

<?xml version="1.0"?>
                <add assembly="MySql.Data, Version=, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>

But when in ServerExplorer I try "Add Connection..." I can't find "MySql Database" in the "Choose Data Source" dialog box?

What the problem can be?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend