[Mono-dev] ASP.NET MySql connection

Daniel Morgan monodanmorg at yahoo.com
Mon Dec 18 12:28:47 EST 2006


You are using the wrong classes.

System.Data.SqlClient is for Microsoft SQL Server
clients.

MySql.Data is for MySQL clients.

--- Dariusz Linowski <darlin1 at linbit.pl> wrote:

> Hello,
> 
> I've tried use the mono ASP.NET and meet some
> problem with connection
> to mysql database. I created ASP.NET application
> used VWD tool and try
> to run in environment :
> mono-core-1.2.2.1, XSP2 (xsp-1.2.1-0), and MySql
> Connector NET 1.0.8.
> I received error:
> 
> Description: Error processing request.
> Error Message: HTTP 500.
> Stack Trace:
> System.Data.SqlClient.SqlException: Server does not
> exist or
> connection refused. --->
> Mono.Data.Tds.Protocol.TdsInternalException:
> Server does not exist or connection refused. --->
> System.Net.Sockets.SocketException: Connection
> refused
> 
>   at System.Net.Sockets.Socket.Connect
> (System.Net.EndPoint
> remote_end) [0x00000]
> 
>   at Mono.Data.Tds.Protocol.TdsComm..ctor
> (System.String dataSource,
> Int32 port, Int32 packetSize, Int32 timeout,
> TdsVersion tdsVersion)
> [0x00000] --- End of inner exception stack trace ---
> 
>   at Mono.Data.Tds.Protocol.TdsComm..ctor
> (System.String dataSource,
> Int32 port, Int32 packetSize, Int32 timeout,
> TdsVersion tdsVersion)
> [0x00000]
> 
>   at Mono.Data.Tds.Protocol.Tds..ctor (System.String
> dataSource, Int32
> port, Int32 packetSize, Int32 timeout, TdsVersion
> tdsVersion)
> [0x00000]
> 
>   at Mono.Data.Tds.Protocol.Tds70..ctor
> (System.String server, Int32
> port, Int32 packetSize, Int32 timeout) [0x00000]
> 
>   at (wrapper remoting-invoke-with-check)
> Mono.Data.Tds.Protocol.Tds70:.ctor
> (string,int,int,int)
> 
>   at System.Data.SqlClient.SqlConnection.Open ()
> [0x00000] --- End of
> inner exception stack trace ---
> 
>   at System.Data.SqlClient.SqlConnection.Open ()
> [0x00000]
> 
>   at System.Data.Common.DbDataAdapter.Fill
> (System.Data.DataSet
> dataSet, Int32 startRecord, Int32 maxRecords,
> System.String srcTable,
> IDbCommand command, CommandBehavior behavior)
> [0x00000]
> 
>   at System.Data.Common.DbDataAdapter.Fill
> (System.Data.DataSet
> dataSet, System.String srcTable) [0x00000]
> 
>   at (wrapper remoting-invoke-with-check)
> System.Data.Common.DbDataAdapter:Fill
> (System.Data.DataSet,string)
> 
>   at
>
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect
> (System.Web.UI.DataSourceSelectArguments arguments)
> [0x00000]
> 
> 
> 
> I copied given MySql.Data.dll to the aplication
> directory and
> registered to  to gac using:
> gacutil -i Mysql.Data.dll  and see this assemless in
> /mono /gac
> 
> 
> Additionall information.
> I tried to use other C# CLI aplication to check the
> connection, and
> noticed that application was working only based on
> old Conector NET
> driver Version=1.0.7.30073.
> 
> I checked  connection to mysql via sqlsharp
> application and received error
> too:
> 
> 
> SQL# \loadextprovider
>
MySql.Data,Version=1.0.8.0,Culture=neutral,PublicKeyToken=C5687FC88969C44D
> MySql.Data.MySqlCliet.MySqlConnection
> 
> SQL# \ConnectionString
> Server=XXXX.XXXX.XXXX;Database=eriskcdrdb;User
> ID=YYYY;Password=VVVVV;Pooling=false
> 
> SQL# \Open
> Opening connection...
> Loading external provider...
> Error: unable to load the assembly of the provider:
>
MySql.Data,Version=1.0.8.0,Culture=neutral,PublicKeyToken=C5687FC88969C44D
> : Argument cannot be null.
> Parameter name: type
> 
> 
> sqlsharp connection was working only when is based
> on:
> 
> Assembly: MySql.Data, Version=1.0.7.30073,
> Culture=neutral,
> PublicKeyToken=8e323390df8d9ed4
>   Connection Class:
> MySql.Data.MySqlClient.MySqlConnection
> 
> 
> What is wrong?  I'm new in mono and maybe there is
> my misunderstanding
> or misconfiguration?   Could someone give me some
> advice ?
> 
> Below you can find ASP.NET application files:
> Default.aspx  and web.config
> 
> 
> 
> -------- ----------------------------------------
> Default.aspx
> ------------------------------------------
>      ---------------
> 
> </head>
> 
> <body>
> 
>     <form id="form1" runat="server">
> 
>     <div>
> 
>         <asp:Label ID="Label1" runat="server"
> Text="Label"></asp:Label>
> 
>         <asp:GridView ID="GridView1" runat="server"
> AutoGenerateColumns="False"
> BackColor="LightGoldenrodYellow"
> 
>             BorderColor="Tan" BorderWidth="1px"
> CellPadding="2"
> DataSourceID="SqlDataAster"
> 
>             ForeColor="Black" GridLines="None">
> 
>             <FooterStyle BackColor="Tan" />
> 
>             <Columns>
> 
>                 <asp:BoundField DataField="calldate"
> HeaderText="calldate" SortExpression="calldate" />
> 
>                 <asp:BoundField DataField="clid"
> HeaderText="clid"
> SortExpression="clid" />
> 
>                 <asp:BoundField DataField="src"
> HeaderText="src"
> SortExpression="src" />
> 
>                 <asp:BoundField DataField="dst"
> HeaderText="dst"
> SortExpression="dst" />
> 
>                 <asp:BoundField DataField="dcontext"
> HeaderText="dcontext" SortExpression="dcontext" />
> 
>                 <asp:BoundField DataField="channel"
> HeaderText="channel" SortExpression="channel" />
> 
>                 <asp:BoundField
> DataField="dstchannel"
> HeaderText="dstchannel" SortExpression="dstchannel"
> />
> 
>                 <asp:BoundField DataField="lastapp"
> HeaderText="lastapp" SortExpression="lastapp" />
> 
>                 <asp:BoundField DataField="lastdata"
> HeaderText="lastdata" SortExpression="lastdata" />
> 
>                 <asp:BoundField DataField="duration"
> HeaderText="duration" SortExpression="duration" />
> 
=== message truncated ===>
_______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
>
http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Mono-devel-list mailing list