Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
How can i overwrite the SQL server 2005 connection by MySql please help
Posted
Comments
Kenneth Haugland 21-Jan-13 9:21am    
That would depend, what have you tried?

1 solution

1) install mysql connector[^]
2) add reference to the mysql specific assamblies
3) replace in your code all SQL server specific objects with mysql specific ones according to the documentaton: http://dev.mysql.com/doc/refman/5.1/en/connector-net-ref-mysqlclient.html[^]
4) change connection string: http://www.connectionstrings.com/mysql[^]

Not only if you are using EF, you should check this article: Using MySQL with Entity Framework[^]
 
Share this answer
 
v3
Comments
NISHANTHAYLARA 21-Jan-13 9:35am    
Dear bro when I override the connection, The home page doesn't load it shows the following error

This webpage has a redirect loop
The webpage at http://localhost:27083/onlinetradingsystem/Home.aspx has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
Here are some suggestions:
Reload this webpage later.
Learn more about this problem.
Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.
can i have your emailid , mine is [email removed],please help
Zoltán Zörgő 21-Jan-13 9:43am    
What home page doesn't load? The url is on your machine.
The error is fairly straightforward: the page http://localhost:27083/onlinetradingsystem/Home.aspx contains a redirect to itself. Check the code, error logs and debug.
I can't help you with this one...
NISHANTHAYLARA 21-Jan-13 9:49am    
actually I am new to this platform, can you said howcan i overcomethe redirect loop i am trying on this code

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="home.aspx.cs" Inherits="home" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 
<asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="X-Large" ForeColor="#FFC080"
Style="z-index: 100; left: 353px; position: absolute; top: 162px" Text="Welcome To Online Trading "
Width="311px">
<asp:Panel ID="Panel1" runat="server" Height="357px" Style="z-index: 102; left: 265px;
position: absolute; top: 201px" Width="493px">
 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="DSN=MySql;UID=root;server=localhost;database=onlinetrading;port=3306;"
SelectCommand="SELECT [accid], [owner], [DOB], [income], [emailid], [experience], [state], [address], [country], [phno] FROM [register] WHERE ([owner] = @owner)" UpdateCommand="UPDATE register SET income = @income, emailid = @emailid, DOB = @DOB, owner = @owner, phno = @phno, country = @country, address = @address, state = @state, experience = @experience" ProviderName="System.Data.Odbc">
<SelectParameters>
<asp:SessionParameter Name="owner" SessionField="owner" Type="String" />
</SelectParameters>

<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" BackColor="#FFE0C0"
DataKeyNames="accid" DataSourceID="SqlDataSource1" Font-Bold="True" Font-Size="Larger"
ForeColor="MediumSlateBlue" Height="166px" Style="z-index: 100; left: 130px;
position: absolute; top: 71px" Width="292px" AutoGenerateEditButton="True">
<fields>
<asp:BoundField DataField="accid" HeaderText="accid" InsertVisible="False" ReadOnly="True"
SortExpression="accid" />
<asp:BoundField DataField="owner" HeaderText="owner" SortExpression="owner" />
<asp:BoundField DataField="DOB" HeaderText="DOB" SortExpression="DOB" />
<asp:BoundField DataField="income" HeaderText="income" SortExpression="income" />
<asp:BoundField DataField="emailid" HeaderText="emailid" SortExpression="emailid" />
<asp:BoundField DataField="experience" HeaderText="experience" SortExpression="experience" />
<asp:BoundField DataField="state" HeaderText="state" SortExpression="state" />
<asp:BoundField DataField="address" HeaderText="address" SortExpression="address" />
<asp:BoundField DataField="country" HeaderText="country" SortExpression="country" />
<asp:BoundField DataField="phno" HeaderText="phno" SortExpression="phno" />



Zoltán Zörgő 21-Jan-13 9:57am    
This code has nothing special in it. Use IE9 Developer toolbar or fiddle to catch first redirect, and see details.
NISHANTHAYLARA 21-Jan-13 9:59am    
thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900