|
Try taking the out the "collate and Latin1..." part. For example:
'PKID' VARCHAR(50) NOT NULL
Also make sure you have created a database to put the tables into - a lot of people forget that.
|
|
|
|
|
Me too, fails on the first index creation. Has anyone re-written this for MySQL 5 ??
|
|
|
|
|
remove all ' then it works fine
|
|
|
|
|
Hey
Is it easy to convert this to use Microsoft SQL server.
And how do i use this code to ensure that user are logged in on my pages??
|
|
|
|
|
|
If you are using MS SQL you do not need to do anything just add the pages and the objects. VWD automatically puts in all the tables and so forth for you. It does not always show up in the explorer. To see it right click on the "APP_DATA" folder, select "add existing item" navigate to your project folder, in your project folder you will see the folder "APP_DATA" open that up and in there you will see a file called "ASPNETDATA" select that and you are all set.
That file does not get created until you run the program and you are using the "create user wizard".
|
|
|
|
|
How can you extend the memebership to use more fields like FirstName, LastName, Age, JobTitle ... etc and how do you use them in code?
Thanks in advance
Go FullMobile for good Autos
|
|
|
|
|
Membership only provides login information.
You have to create a custom profile provider for that
--
http://katro.net
|
|
|
|
|
Can someone tell me why the data type for ApplicationName in the Roles table is VARCHAR while the data type for ApplicationName in the UsersInRoles table is TEXT?
|
|
|
|
|
Once I have added this provider code to my application, should I be able to see the provider on the Provider tab of the Web Site Administraction Tool?
|
|
|
|
|
No, in fact if you are using this type of database connection do not use the admin tool. this adds stuff to the web.config file and will mess things up.
IMO the Admin Tool is dumb since you can do what you want it to do with just a couple of lines or changing a property. everytime I have used it (even with MS SQL) it gives errors/warnings in the web.config file.
|
|
|
|
|
The scripts won't run on my web site b/c the web hosting company limits the trust level to "Medium". I can not override it to high/full. Is there a workaround?
|
|
|
|
|
I guess the code doesn't run under Medium trust, because it uses the MySQL.NET connector. However, most providers do allow the MySQL ODBC connector, so if you change the code to use this ODBC connector, this would solve your problem.
--Dion
|
|
|
|
|
|
It seems the last MySQLDirect provider by CoreLab (3.20.8 and up) is now enabled for medium trust sites!!
|
|
|
|
|
Can you tell me how to make the code using ODBC instead of MySQL Connector? Share me please
|
|
|
|
|
For some reson i get an error when i try to use the sql you have writen, the only part of it i can execute in any way is the creation of the Role table. the rest is buggy, ie. the Text in the creation of the userinroles, make an error, as far as I remember it's cause you can't make a limiter on such a fiel, I tryed to change it to a Varchar and that worked, but the rest i can't fix, neither the Alter's nor the user table
Hope someone is able to help me out on this.
|
|
|
|
|
sql language in mysql changes from one version to another. Just create the tables and the primary keys with whatever tools you have.
--
http://katro.net
|
|
|
|
|
To make these providers work on a VB website, you will need to compile them with csc.exe and reference the mysql driver that you are using. To do so:
1. Place the MySqlMembershipProvider.cs and the MySqlRoleProvider in the App_Code dir on the machine that your website will run on.
2. Do a search on your pc for csc.exe. You will probably have a few of these in different directories. Use the one in your WINDOWS\Microsoft.NET\Framework\v2.0.xxxxx directory. Open a command prompt window and cd to this directory (cd \WINDOWS, then cd Microsoft.NET and so on). Once in this directory, you will need to type in the command to compile each .cs file. Depending on which MySql Driver you are using, you will need to add a reference to it in the compile command with the /r switch.
The command I used looked like:
csc /r :\Inetpub\wwwroot\bin\MySql.Data.dll /target:library /out :\Inetpub\wwwroot\bin\MySqlMembershipProvider.dll D:\Inetpub\wwwroot\App_Code\MySqlMembershipProvider.cs
You won't put any line breaks in. This is all one line. Do he same for the role provider. Also, don't compile these on one machine and expect them to work on another.
Once it has compiled, you should be able to start the website Administration page, select 'Security' and you should be able to add users and what not.
The only thing you can't do, or will fail if you try, is to test the providers. Otherwise, it works. You might read the rest of the comments for info on setting up the tables.
Happy Motoring!
|
|
|
|
|
Hi Nakins,
Need your assistance to check on the compile command stated above. I had downloaded the MySQL ODBC/Connector driver 3.51 but was unable to find MySql.Data.dll inside my laptop.
I am currently trying to develop a .NET application that inerfaces with MySQL as a backend db.I had tried to compile MySqlMembershipProvider.cs with the command you had stated above. However, I was unsuccessful in doing so as there are errors from the command. They are copied as follows below.
Just another question, do I have to move all of my development files into the ~\Inetpub\wwwroot\ folder?
Thanks in advance for your help!
Errors messages:-
error CS2001: Source file 'Project\EAMS' could not be found
error CS2001: Source file 'Program\EAMS\App_Data\MySqlMembershipProvider.dll'
could not be found
error CS2001: Source file 'D:\Academic\Wales' could not be found
error CS2001: Source file 'Project\EAMS' could not be found
error CS2001: Source file 'Program\EAMS\App_Data\MySqlMembershipProvider.cs'
could not be found
fatal error CS2008: No inputs specified
Cheers,
Jazzyjas78
|
|
|
|
|
Well, first of all, there are two mysql drivers. there is the MyODBC driver you have, and there is the Connector.NET driver. I use both. You need to download the Connector.NET driver (from MySql) and place it in your bin folder that is located in your Inetpub/wwwroot for your project directory. I can't remember if there was any speical instructions needed for this, so, you might look around to find instruction on how to install theConnector.net driver.
Use the Inetpub/wwwroot directory structure to develop and to run live. So, yes, you need to move your files to that directory.
Once you get these things done, try compling again like I stated.
|
|
|
|
|
Hi Nakins,
Thanks for your advice! I had managed to compile the two .dll files successfully. However, when I went into ASP.NET Web Site Admin Tool, I received the same error you had encountered earlier regarding errors in the web.config file.
Error message is like this; "The following message may help in diagnosing the problem: Could not load type 'Andri.Web.MySqlMembershipProvider'. (D:\Academic\Wales Project\EAMS Program\EAMS\web.config line 35)"
Thanks for your help so far and sorry for bothering you repeatedly today!
Cheers,
jazzyjas78
|
|
|
|
|
You won't be able to select the role provider in the admin tool. Why? I don't know. But you should be able to go to security or the users section, whatever it is, and be able to add users and roles and such.
Here is what my config file looks like. Your will be different in the connection strings and the application name. Hope this helps. I'll be gone the rest off the day.
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<connectionStrings>
<add name="mydbConnectionString" connectionString="DATABASE=db;DSN=myodbc;OPTION=0;PORT=0;UID=me"
providerName="System.Data.Odbc" />
<add name="connectionString" connectionString="Database=db;Data Source=localhost;User Id=admin;Password=admin" />
<add name="HomeConnectionString" connectionString="Dsn=myodbc2;uid=me;pwd=me"
providerName="System.Data.Odbc" />
</connectionStrings>
<system.web>
<authentication mode="Forms" />
<authorization>
</authorization>
<compilation debug="true"/>
<membership defaultProvider="MySqlMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear/>
<add name="MySqlMembershipProvider" type="Andri.Web.MySqlMembershipProvider" connectionStringName="connectionString" applicationName="myWebSite" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="Hashed" writeExceptionsToEventLog="true"/>
</providers>
</membership>
<roleManager defaultProvider="MySqlRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All">
<providers>
<clear/>
<add name="MySqlRoleProvider" type="Andri.Web.MySqlRoleProvider" connectionStringName="connectionString" applicationName="myWebSite" writeExceptionsToEventLog="true"/>
</providers>
</roleManager>
</system.web>
</configuration>
-- modified at 13:54 Sunday 26th February, 2006
|
|
|
|
|
Just wanted to thank you for sharing this! It saved me *many* hours of work!
Thanks++
karl
|
|
|
|
|
I have my site in vb. Whats the chances of getting this written in vb? I'm rather new to all this and wonder if I can do the conversion myself. Any suggestion on this would be helpful. Also, I was wondering why you were using compound indexes? I tried to cut and paste the table creation commands into the mysql command window, but have to remove the single quotes to get it to take. Tables were created and they seem correct, however.
Thanks
|
|
|
|