MySQL and Gridview

Dear All,

 I would like to use the MySQL .net connector to connect to my MySQL database. I can get the connection set up and display data from a table using the Gridview. But, I cannot control the layout options such as paging, insertion, editing and deletion. Is there a way that this can be achieved?

The code that I have been using to connect to my MySQL database is below:

 

<%@ Page Language="VB" debug="true" %> <%@ Import Namespace = "System.Data" %>

<%@ Import Namespace = "MySql.Data.MySqlClient" %>

<script language="VB" runat="server">

Sub Page_Load(sender As Object, e As EventArgs)

Dim myConnection As MySqlConnection

Dim myDataAdapter As MySqlDataAdapter

Dim myDataSet As DataSet

Dim strSQL As String

Dim iRecordCount As Integer

myConnection = New MySqlConnection("server=localhost; user id=******; password=******; database=jamestest; pooling=false;")

strSQL = "SELECT * FROM test;"

myDataAdapter = New MySqlDataAdapter(strSQL, myConnection)

myDataSet = New Dataset()

myDataAdapter.Fill(myDataSet, "test")

MySQLDataGrid.DataSource = myDataSet

MySQLDataGrid.DataBind()

End Sub

</script>

<html>

<head>

<title>Simple MySQL Database Query</title>

</head>

<body>

<form id="Form1" runat="server">

<asp:DataGrid id="MySQLDataGrid" runat="server" />

<asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource>

</form> </body>

</html>

I found this code off of another website, and understand how most of it works.

 

James

0
obrien
10/11/2008 12:18:13 AM
asp.net.mysql 1929 articles. 0 followers. Follow

13 Replies
657 Views

Similar Articles

[PageSpeed] 40

 Kindly checkout this link:

http://www.15seconds.com/issue/060317.htm 


Please Mark as Answred If This Blog has Helped You.


Regards
Mitesh Darji
http://www.indianic.com
http://www.mitatdotnet.blogspot.com
0
Mitesh_Darji
10/11/2008 3:41:13 AM

The part of the article that refers to the .net connector is for a connector provided by another company. I have been using the MySQL Connector.Net 5.2.3 connector. Can I adapt the code so that all of the other features such as insert, paging, deletion, edit work??

 

James

0
obrien
10/11/2008 7:27:19 AM

Couple of things:

1) I think you can do it.  I have been using v5.2.3 and have an application that does insert, edit and delete on a gridview.  I'll have to go back and look to see how I did it.  Seems like I may have wrote some code-behind, and I imagine you would rather avoid that.  I'll see if I can find an example where used strictly design view to configure.
2) What version of Visual Studio are you using?  v5.2.3 has, I think, pretty strong support for configuring those types of things in VS 2008 Professional from the smart tags in design view. 


Marvin

If, by some rare and amazing chance, I suggested a solution that actually worked for you, please mark the post as "ANSWER" because, hey, I don't pull that off very often. ;-)
0
palmerm1
10/18/2008 2:38:00 AM

Ok, I just created a basic page with a SqlDataSource that does all that you are wanting to do. 

Here's what I did.  Drag a SqlDataSource from the Toolbox over onto your page in Design view.  Click the Smart Tag and Configure Data Source.  Click New Connection.  If you are working with a local installation of MySql then most likely the Server Name is localhost, the user name is root, and the password is whatever you specified when you installed and configured MySql server on your computer.  Pick your database.  Always a good idea to click the Test Connection button here to make sure it's working.  Now, walk through the rest of the wizard (Next, Next).  When you get to the "Configure the Select Statement" page, after you have specified which table you are querying and which fields, make sure that you click on the advanced button on the right and click the Generate Insert, Update, and Delete statements.  Now finish out the wizard. 

At this point, you need to go to source view.  For me, the statements that are generated are not correct MySql syntax, so you have to fix them.  Easiest is to do a find/replace in source view and replace all "["'s and "]"'s with "`"..  Keep in mind, that's not an apostrophe.  It's the other similar looking character (I don't know what you call it) to the left of your 1 on the top number row of your keyboard.  You will also need to add the actual field names after the "?"'s in the insert, update and delete statements in order for the parameters to work correctly. 

Ok, now go back to your Design View, drag a GridView control onto your page, in the Smart Tag for the GridView, select Choose Data Source and select the data source on your page which you just created (probably called SqlDataSource1 unless you changed the name when you created it).  Hit refresh schema.  If it's working, it will might give you some confirmation box, but afterwards, it should refresh your GridView and show the columns in your data source.  Click your smart tag in your GridView again and click checkboxes next to Enable Paging, Sorting, Editing, Deleting (whatever you want).  Now save the page and run it.  You should see a GridView with ability to do all those things.

For inserting, you need a different control.  A DetailsView control is probably your best bet. The steps are almost identical to what you did with the GridView.

Here's the source code I have after doing all that:

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
</
script>

<html xmlns="http://www.w3.org/1999/xhtml">
<
head runat="server">
<title>Untitled Page</title>
</
head>
<
body>
<form id="form1" runat="server">
<div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
   
ConnectionString="<%$ ConnectionStrings:testConnectionString2 %>"
   
DeleteCommand="DELETE FROM `test` WHERE `TestID` = ?TestID"
   
InsertCommand="INSERT INTO `test` (`TestID`, `FirstName`, `LastName`) VALUES (?TestID, ?FirstName, ?LastName)"
   
ProviderName="<%$ ConnectionStrings:testConnectionString2.ProviderName %>"
   
SelectCommand="SELECT * FROM `test`"
   
UpdateCommand="UPDATE `test` SET `FirstName` = ?FirstName, `LastName` = ?LastName WHERE `TestID` = ?TestID">
<DeleteParameters>
   
<asp:Parameter Name="TestID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
   
<asp:Parameter Name="FirstName" Type="String" />
   
<asp:Parameter Name="LastName" Type="String" />
   
<asp:Parameter Name="TestID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
   
<asp:Parameter Name="TestID" Type="Int32" />
   
<asp:Parameter Name="FirstName" Type="String" />
   
<asp:Parameter Name="LastName" Type="String" />
</InsertParameters>
</asp:SqlDataSource>

</div>
   
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        
AllowSorting="True" AutoGenerateColumns="False" 
        
DataKeyNames="TestID" DataSourceID="SqlDataSource1">
   
<Columns>
       
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
       
<asp:BoundField DataField="TestID" HeaderText="TestID" ReadOnly="True" SortExpression="TestID" />
       
<asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />
       
<asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />
   
</Columns>
    </asp:GridView>

    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="TestID"
       
DataSourceID="SqlDataSource1" Height="50px" Width="125px">
   
<Fields>
       
<asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />
       
<asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />
       
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
    
</Fields>
    </asp:DetailsView>

</form>
</
body>
</
html>

All this assumes you followed the steps above which will create a connection string in your web.config file for you.  So you won't be able to copy this code verbatum and have it work.  Not without the connection string in your web.config anyway.

There's a lot more you could do.  Lots of great articles and videos on this site about using the different data controls. There are also some things to consider when deploying to production.  In case it helps, I use GoDaddy and wrote an article last month about setting up ASP.NET Membership using MySql and hosting on GoDaddy.  I think the first part of that article might give you some additonal helpful hints depending on what you are ultimately trying to do. 

That article is here:

http://www.marvinpalmer.com/MarvinPalmer/post/Implement-NET-Membership-and-Roles-using-MySql-Connector-523-on-GoDaddy.aspx

Hope this helps. 


Marvin

If, by some rare and amazing chance, I suggested a solution that actually worked for you, please mark the post as "ANSWER" because, hey, I don't pull that off very often. ;-)
0
palmerm1
10/18/2008 4:20:52 PM

check dis link u can definetly solve the problem........

http://aspnet.4guysfromrolla.com/articles/021203-1.aspx [with out paging]

http://www.aspnetdatagrid.com/Ex/RowInUpDl.aspx [with paging]


$weety
Mark this post as "ANSWER", if it helped you..
0
anoo_sweety
10/20/2008 5:11:40 AM
//The source file code lies below


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
   
    <script language="javascript" type="text/javascript">
    function check()
    {
  
    if(document.getElementById('<%=txtfirstname.ClientId%>').value=="")
        {
        alert('Please Enter first Name"');
        document.getElementById('<%=txtfirstname.ClientId%>').focus();
         return false;
        }
        if(document.getElementById('<%=txtlastname.ClientId%>').value=="")
        {
        alert('Please Enter lastname "');
        document.getElementById('<%=txtlastname.ClientId%>').focus();
         return false;
        }
             
        if(document.getElementById('<%=txtage.ClientId%>').value=="")
        {
        alert('Please Enter employee age"');
        checknumber();
       
        document.getElementById('<%=txtage.ClientId%>').focus();
         return false;
        } 
        
                }
                
    </script>
   
</head>
<body>
    <form id="form1" action="Default.aspx" method="post" onsubmit="return check(this)" runat="server">
    <div>
        <table id="tbl"  border="2" align="center" cellpadding="0" cellspacing="2" style=" height: 100%" visible=true    runat=server >
      
            <tr bgcolor="#FFFFFF">
                <td >
                                     <asp:Label ID="txtfirstname" runat="server" Text="First Name" Width="246px" ForeColor="#C00000"></asp:Label></td>
                                      <td> <asp:TextBox ID="txt" runat="server" Text=""></asp:TextBox>
                                      </td>
                                     
                                                  </tr>
            <tr>
                <td >
                    <asp:Label ID="txtlastname" runat="server" Text="last Name" ForeColor="#C00000"></asp:Label></td>
                                      <td>  <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
                                           
            </tr>
            <tr>
                <td >
                    <asp:Label ID="txtage" runat="server" Text="Age" ForeColor="#C00000"></asp:Label></td>
                <td>
                    <asp:TextBox ID="textbox2" runat="server"></asp:TextBox></td>
            </tr>
        </table>
                                          <asp:HiddenField ID="hdn" runat="server" />
   
    </div>
    <table id=tbl1 align= center visible=true runat=server>
    <tr>
    <td>
    <asp:Button id=btnSave align=center CommandName="Save"  Text=Save runat=server />
    <asp:Button ID="btnReset" align=center  Text=Reset runat=server />
    <asp:Button ID="btnCancel" align=center  Text=Cancel runat=server />
   
   
    </td>
    </tr>
    </table>
    <table align=center style="width: 132px">
    <tr>
    <td>
    <asp:Label ID=err visible=false  runat=server>
    </asp:Label>
    </td>
    </tr>
    </table>
    <table id=tbl3  align=right >
   
  
    </table>
   

        <asp:GridView ID="GridView1" width="100%" AllowSorting="true" AllowPaging="TRUE" runat="server" AutoGenerateColumns="false" BackColor="#FFE0C0" BorderColor="Blue" BorderStyle="Double" ForeColor="Maroon" PageSize="3" >
        <Columns >
            <asp:BoundField DataField="id"  SortExpression ="id"  HeaderText="Emp Id." >
                <HeaderStyle Width="100px" />
            </asp:BoundField>
            <asp:BoundField DataField="empfname" HeaderText="First Name"  SortExpression="empfname" >
                <HeaderStyle Width="100px" />
            </asp:BoundField>
            <asp:BoundField DataField="emplastname" HeaderText="Last Name"  SortExpression="emplastname">
                <HeaderStyle Width="150px" />
            </asp:BoundField>
            <asp:TemplateField>
                  <ItemTemplate>
                
                  <asp:HyperLink ID="hyk" Text = "Edit"  NavigateUrl='<%# Edit(DataBinder.Eval(Container, "DataItem.id")) %>'  runat="server">
                  </asp:HyperLink>
                  </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                  <ItemTemplate>
                
                  <asp:HyperLink ID="hyk" Text = "Delete"   NavigateUrl='<%# Del(DataBinder.Eval(Container, "DataItem.id")) %>'  runat="server" >
                  </asp:HyperLink>
                  </ItemTemplate>
        </asp:TemplateField>

                   
        </Columns>
       
       
        </asp:GridView>
       
       
    </form>
</body>
</html>







The asp.vb code lies here..........!!!!!!!!!!


Imports System.Data.SqlClient
Imports System.Data
Imports System.Configuration

Partial Class _Default
Inherits System.Web.UI.Page
Public Shared uid As String
Dim mode As String
Dim flag As Boolean
Dim dv As DataView

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Not IsPostBack Then
uid = Request.QueryString("uid")
mode = Request.QueryString("mode")
flag = True
Session("id") = uid
BindGrid()
Else

End If

If uid <> "" Then
btnSave.Text = "Update"
btnSave.CommandName = "Update"
Else
btnSave.Text = "Save"
btnSave.CommandName = "Save"
End If
If (mode = "D") Then
btnSave.Text = "Update"
DelRecord(uid)

ElseIf uid <> "" And flag = True Then
flag = False
BindRecord(uid)
tbl.Visible = True
tbl1.Visible = True
End If


btnSave.Attributes.Add("OnClick", "return check();")

End Sub

Public Sub BindGrid()
Dim Connstr As String
Connstr = "Server=dotnetrs; uid=sa; pwd=rahul; database=testingdatabase"
Dim conn As New SqlConnection(Connstr)
Dim strqry As String
strqry = "select id,empfname,emplastname from [TestingDataBase].[dbo].[emp]"
Dim ad As New SqlDataAdapter(strqry, conn)
Dim dt As New DataTable
ad.Fill(dt)
Session("datatable") = dt
dv = dt.DefaultView()
GridView1.DataSource = dv
GridView1.DataBind()
End Sub

Protected Function edit(ByRef id) As String

Return "default.aspx?uid=" & id
End Function
Protected Function del(ByRef id) As String
Return "default.aspx?uid=" & id & "&Mode=D"
End Function

Public Sub BindRecord(ByRef id)

Dim Connstr As String
Connstr = "Server=dotnetrs; uid=sa; pwd=rahul; database=testingdatabase"
Dim conn As New SqlConnection(Connstr)
Dim strqry As String

Dim dt As New DataTable
err.Visible = False
strqry = "select * from [TestingDataBase].[dbo].[emp] where id =@id"
Dim cmd As New SqlCommand(strqry, conn)
cmd.CommandType = CommandType.Text
cmd.Parameters.Add("@id", SqlDbType.Int).Value = id
Dim ad As New SqlDataAdapter(cmd)
ad.Fill(dt)
Dim dtrow As DataRow
If Not IsNothing(dt) Then

For Each dtrow In dt.Rows
txt.Text = dtrow("empfname")
TextBox1.Text = dtrow("emplastname")
textbox2.Text = dtrow("age")


Next
End If
End Sub

Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim obj(3) As Object
obj(0) = txt.Text

obj(1) = TextBox1.Text
obj(2) = textbox2.Text
If btnSave.CommandName = "Save" Then
save(obj)
ElseIf btnSave.CommandName = "Update" Then
Update(obj)
End If


End Sub

Protected Sub Update(ByRef obj)
Dim Connstr As String
Connstr = "Server=dotnetrs; uid=sa; pwd=rahul; database=testingdatabase"
Dim conn As New SqlConnection(Connstr)
Dim strqry As String
Dim ad As New SqlDataAdapter


strqry = "update [TestingDataBase].[dbo].[emp] set empfname=@empfname,emplastname=@emplastname,age=@age where id=@id"
Dim cmd As New SqlCommand(strqry, conn)
cmd.Parameters.Add("@empfname", SqlDbType.VarChar).Value = obj(0)
cmd.Parameters.Add("@emplastname", SqlDbType.VarChar).Value = obj(1)
cmd.Parameters.Add("@age", SqlDbType.Int).Value = obj(2)
cmd.Parameters.Add("@id", SqlDbType.Int).Value = uid

conn.Open()
Dim ret As Integer = cmd.ExecuteNonQuery()
If (ret = 1) Then

err.Visible = True
err.Text = "Record has Been sucessfully updated"
BindGrid()
tbl.Visible = True
tbl1.Visible = True
reset()

Else
err.Visible = True
err.Text = "Error in saving"
BindGrid()
End If

End Sub
Protected Sub DelRecord(ByVal uid)
Dim Connstr As String
Connstr = "Server=dotnetrs; uid=sa; pwd=rahul; database=testingdatabase"
Dim conn As New SqlConnection(Connstr)
Dim strqry As String
Dim dt As New DataTable


strqry = "delete from [TestingDataBase].[dbo].[emp] where id = @id"
Dim cmd As New SqlCommand(strqry, conn)
cmd.CommandType = CommandType.Text
conn.Open()
cmd.Parameters.Add("@id", SqlDbType.Int).Value = uid
Dim ret As Integer = cmd.ExecuteNonQuery()
If (ret = 1) Then

err.Visible = True
err.Text = "Record is Deleted"
BindGrid()
btnSave.Text = "Save"
btnSave.CommandName = "Save"
mode = ""


Else
err.Visible = True
err.Text = "Error in Deletion"
BindGrid()
End If
End Sub


Protected Sub save(ByVal obj)
Dim Connstr As String
Connstr = "Server=dotnetrs; uid=sa; pwd=rahul; database=testingdatabase"
Dim conn As New SqlConnection(Connstr)
Dim strqry As String
Dim ad As New SqlDataAdapter


strqry = "insert into [TestingDataBase].[dbo].[emp] (empfname,emplastname,age) " & _
" values (@empfname,@emplastname,@age)"

Dim cmd As New SqlCommand(strqry, conn)
cmd.Parameters.Add("@empfname", SqlDbType.VarChar).Value = obj(0)
cmd.Parameters.Add("@emplastname", SqlDbType.VarChar).Value = obj(1)
cmd.Parameters.Add("@age", SqlDbType.VarChar).Value = obj(2)
conn.Open()
Dim ret As Integer = cmd.ExecuteNonQuery()
If (ret = 1) Then

err.Visible = True
err.Text = "Record updated"
tbl.Visible = True
tbl1.Visible = True
GridView1.Visible = True
BindGrid()
reset()
txt.Focus()
btnSave.CommandName = "Update"
Else
err.Visible = True
err.Text = "Error in saving"
BindGrid()
End If

End Sub

Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
Response.Redirect("default.aspx")
End Sub

Protected Sub btnReset_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReset.Click
txt.Text = ""
TextBox1.Text = ""
textbox2.Text = ""
err.Visible = False
End Sub
Public Sub reset()
err.Visible = False
txt.Text = ""
TextBox1.Text = ""
textbox2.Text = ""
btnSave.Text = "Save"

End Sub

Protected Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GridView1.PageIndexChanging
BindGrid()
GridView1.PageIndex = e.NewPageIndex
GridView1.DataBind()
End Sub

Protected Sub GridView1_SelectedIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSelectEventArgs) Handles GridView1.SelectedIndexChanging



End Sub

Protected Sub GridView1_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles GridView1.Sorting
If ViewState("direction") = Nothing Or ViewState("direction") = "Desc" Then
ViewState("direction") = "Asc"
Else
ViewState("direction") = "Desc"
End If

Dim dvDataView = New DataView(Session("datatable"))
dvDataView.Sort = e.SortExpression & " " & ViewState("direction")
GridView1.DataSource = dvDataView
GridView1.DataBind()
End Sub
End Class


 


$weety
Mark this post as "ANSWER", if it helped you..
0
anoo_sweety
10/20/2008 5:18:47 AM

Thanks for your reply, I know that I haven't posted back in a while.

I was following your explination on adding the SqlDataSource in design view, but when i click on configure and then new connection i have to sellect a ODBC driver. I want to use the connector.net instead of the ODBC driver. Am I doing something wrong? or is something not installed correctly?

 

James

0
obrien
11/1/2008 9:52:02 AM

Hmmm...might be an issue with the install, but before we go down that road, try this.  So, you are configuring the connection, you click new connection, and at the Add Connection window, click "Change" next to the data source that is displayed, like this:

At the next screen, you should see "MySQL Database" as an option, like this:

If you don't see it, then I think you may have an issue with your install of the .NET connector.  If it's there, though, just pick it and click ok.  Try that and post back with results.


Marvin

If, by some rare and amazing chance, I suggested a solution that actually worked for you, please mark the post as "ANSWER" because, hey, I don't pull that off very often. ;-)
0
palmerm1
11/3/2008 2:38:13 PM

Hi,

 I thought that it might be a connector issue, so i reinstalled the connector this morning (5.2.3), and it still does not show up with that. I had a look in my machine.config and there is a reference to the .net connector but it still doesnt show.

I am using win Vista, im not sure if that is going to cause a problem???

 

James

0
obrien
11/3/2008 6:16:05 PM

Yeah, I don't know whether Vista could have anything to do with it or not.  Just curious...what does the <assemblies> section of your web.config look like?  This would be under <system.web><compilation>.


Marvin

If, by some rare and amazing chance, I suggested a solution that actually worked for you, please mark the post as "ANSWER" because, hey, I don't pull that off very often. ;-)
0
palmerm1
11/3/2008 9:21:40 PM

Hi,

 My assemblies looks like this:

<compilation debug="false" strict="false" explicit="true">

<assemblies>

<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="System.Data.Services, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="System.Data.Services.Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="MySql.Data, Version=5.2.3.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>

<add assembly="MySql.Web, Version=5.2.3.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>

</assemblies>

</compilation>

and my machine.config also has a reference to the mysql.data:

<system.data>

<DbProviderFactories>

<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=5.2.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />

</DbProviderFactories>

</system.data>

James

 

 

0
obrien
11/3/2008 10:21:58 PM

Ps. The option is not there on the wizzard. Also when I go to configure data source i cant use the query builder

 

0
obrien
11/6/2008 5:36:30 PM

Man, I'm sorry.  I've run out of ideas.  Not sure where the glitch is.  I do sometimes run into problems with smart tags on controls not working if I use a connection that has already been configured, but I've always been able to configure a new connection without any trouble.


Marvin

If, by some rare and amazing chance, I suggested a solution that actually worked for you, please mark the post as "ANSWER" because, hey, I don't pull that off very often. ;-)
0
palmerm1
11/7/2008 6:10:23 AM
Reply:

Similar Artilces:

MySQL
Currently have a site coded in PHP but the customer wants to go to .NET. Can I use the existing MySQL DB or am I required to use MSSQL? Thanks, Ken Check out this forum which is specialized for this kind of questions: ASP.NET MySQL forumBart De Smet [MVP] Visit www.msdn.be, www.bartdesmet.net...

mysql php5-mysql
Hi, i have installed mysqk from binaries itworks!!! but now how can i install php5-mysql and dependencies? Many thanks Thierry -- trazomtg ------------------------------------------------------------------------ When you say from the binaries, do you mean you installed via Yast and the Suse repositories?? It is always best to install via Yast-Software-Software Management if you can. This way all dependencies are done for you. -- gogalthorp ------------------------------------------------------------------------ gogalthorp's Profile: http://forums.opensuse....

Any Grid for MySQL in .Net except the gridview in VS2005???
i using Connector 5.0.7, and if i use gridview to display the db data,the sorting,paging function all cant be use. any other tools to intro ? which can support for MySQL paging,sorting and other function. i found RadGrid, http://www.telerik.com/demos/aspnet/Grid/Examples/Programming/SimpleBinding/DefaultCS.aspx but i not sure it can fully utilize under MySQL or not? anyone try it before?C####################################### No one can help???C#######################################...

Net::MySQL
------=_NextPart_000_0026_01C30A6E.486AE070 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Anyone run into this problem=20 $mysql->query(q{ INSERT INTO dbname (table_name) VALUES ( $var ) }); The problem is, when I assign a value to a $var that value is ignored in = the SQL statement. Ive tried every operator I know to get it to look at = it and accept the value as input into the DB. Ive tried=20 ( '$var' ) ("$var") ("\$var") ([$var]) ({$var}) Any ideas ? Kind regards...

linked server MySql to Mysql
Can i make linked server from MySql to another Mysql server?...

Suse MySQL and MySQL workbench
I am looking at the downloads here 'MySQL :: Download MySQL Workbench' (http://dev.mysql.com/downloads/workbench/1.0.html#downloads) and 'MySQL :: Download MySQL Community Server' (http://dev.mysql.com/downloads/mysql/#downloads). As one is source code and the other is suse enterprise linux, are these the best downloads for MySQL on suse 11.3? Is there a best source for the install? Suse specific rpm's? -- flebber ------------------------------------------------------------------------ Try zypper or YAST first to look at the OpenSuSE repositories. ...

mysql and .net
Hi there, i am new to .net and i am trying to setup a simple form. I am an open source person and what i am asking can be done easily using php and mysql; but i need to know how to do this in .net project asap. i have three forms; form1 submit to the database and redirect to form2 and form2 submit to the database and redirect to form3. i want to grab mysql last inserted id from form1 to form2 while redirecting and pass it via the url. i am able to select from the database, but i don't know how to assign it to a variable; here is what i have so far: str2 = "select last_ins...

Perl Mysql
Hi all, I am installing Bugzilla3 on a windowsXP box together with Mysql5.0.45 and ActivePerl-5.8.8.820. It passed the checksetup and created the database. However, when I point my Firefox to http://localhost/ I got the following error: install_driver(mysql) failed: Can't load 'C:/Perl/site/lib/auto/DBD/mysql/mysql.dll' for module DBD::mysql: load_file:The specified module could not be found at C:/Perl/lib/DynaLoader.pm line 230. at (eval 34) line 3 Compilation failed in require at (eval 34) line 3. Perhaps a required shared library or dll isn't installed...

DBD::mysql bad auto/DBD/mysql/mysql.bundle file on OS X
Howdy group :) Having a bit of trouble getting DBD::mysql installed on OS X I get this error: root# perl -e 'use DBD::mysql;' Can't load '/Library/Perl/5.8.1/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: /Library/Perl/5.8.1/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle(2): Not a recognisable object file at -e line 1 Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1. root# Here is what is in the directory: root# ls /Library/Perl/5.8.1/darwin-thread-multi-2level/au...

Mysql
how to write a connection string for Mysql  with asp.net2.0 using different connections. Thanks in advance.  Using MyODBC its "Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=myDataBase;User=myUsername;Password=myPassword;Option=3;"Using OleDbConnection its "Provider=MySQLProv;Data Source=mydb;User Id=myUsername;Password=myPassword;"  I just thought of asking if you probably are having trouble switching databases when connecting to your mysql db.Now, the good thing is MySQL provides a connector to asp.net, and you can download free of charge...

MySQL
Can I use MySQL as database or am I limited to Access and MSSQL? Hi, You can use database other than Access / MSSQL in ASP.NET, FYI: view post 249017 and view forum 56 Colt...

mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib service mysql start Starting service MySQL warning: /var/lib/mysql/mysql.sock didn't appear within 3 need help thanks -- ansonelliott ------------------------------------------------------------------------ Have you ensured both mysqld and apache are running? YaST > System > System services (if I remember correctly) allows you to set both to start automatically on boot. -- john_hudson -----------------------------------------------------------------------...

MySQL
Anyone using PB with MySQL as their database? Just about everything is going fine except the current ODBC driver doesn't support cursors which we're having some difficulty getting around for one function of our program. Terrill ...

MYSQL
Have ASE 12.5 on Linux box with the Rep Server on the box as well. Another part of the org want to rep data from ASE to MYSQL. Although Sybase Rep does not support Mysql...I thought through the ODBC connector it would. Please help Your thinking is wrong! > Have ASE 12.5 on Linux box with the Rep Server on the box > as well. Another part of the org want to rep data from > ASE to MYSQL. Although Sybase Rep does not support > Mysql...I thought through the ODBC connector it would. > Please help ...

Web resources about - MySQL and Gridview - asp.net.mysql

GridView SelectedItem Binding Gotcha in WinRT
Last night when I was doing some WinRT hacking I was trying to setup databinding to the selected item in the GridView control and I ran into ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Advanced Search Gridview Latest News Releases All ...

CNW Group
... Services Beyond the Wire About CNW my CNW CNW Access CNW Directories Financials Webcasts Events my CNW All News Releases Advanced Search Gridview ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Add a Filter Gridview Latest News Releases All Today ...

New CmdLets of Powershell 2.0
New CmdLets of Powershell 2.0

Price Drop: Softbox
... objects- create product reflection- changing the background with something more interestingUse it as:- softbox- honeycomb softbox- gridview ...

Profile.aspx: ASP Alliance
.NET,ASP,ASP.NET,SQL,XML,HTML,ADO,ADO.NET,JavaScript,JScript,CSharp,VBScript and VB tutorials from AspAlliance.

Quick Answers - CodeProject
Questions - Free source code and tutorials for Software developers and Architects.; Updated: 25 Oct 2012

DotNetKicks.com - Upcoming stories
DotNetKicks.com is a community based news site edited by our members. It specialises in .NET development techniques, technologies and tools including ...

View Features - ExtendASP
Call 847-681-9827 or Request a Demo View Features Testimonials Pricing About Us Coming Soon ExtendASP exposes every feature, more than any other ...

Resources last updated: 11/25/2015 2:18:42 PM