connect af mySQL database til asp.net site
Jeg har en mySQL database på et webhotel, som jeg ønsker at connecte til mit ASP.NET site, som ikke kører på en server men blot på min udviklings-pc. Er dette muligt?jeg fandet dette site http://www.aspnet101.com/aspnet101/tutorials.aspx?id=39
som forklarer hvordan man connector en mysql med asp.net. men jeg forstår ikke hvor han vil have at man tilføjer koden???
"For MySQL, the driver which you downloaded (above), is an ODBC Driver, therefore, numbers 1 and two in the above list use 'ODBC':
<%@ Import Namespace="System.Data.ODBC" %>
And, you use classes like ODBCDataAdapter, ODBCDataReader, ODBCCommand, etc.
To finish out the three items in the above list, here, we show you the Connection String needed:
"Driver={MySQL ODBC 3.51 Driver};uid=YourUID;password=YourPWD;Server=YourServerIP;Option=16834;Database=YourDB;"
or, you can use:
"DRIVER={MySQL};SERVER=ServerIP; DATABASE=YourDB;USER=YourUID;PASSWORD=YourPWD; OPTION=3;"
Just change these few things, in your code, and you're off and running, using MySQL in your own ASP.Net documents! "