Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

c# login with mysql

  • 28-01-2008 2:59pm
    #1
    Closed Accounts Posts: 51 ✭✭


    Hey all

    im looking to have a login screen on a website, that will refer to a mysql database with c# login or asp.net.
    can anyone please help me on this, i have searched the Internet high and low and still havn't found anything that matches up to my needs


Comments

  • Closed Accounts Posts: 5,284 ✭✭✭pwd


    google for the membership provider schema for mysql. This will set up all the database tables etc that you need.


  • Registered Users, Registered Users 2 Posts: 413 ✭✭ianhobo


    Well, firstly, c# and dot net has an entire built in security and authentication model for starters. Click and drag
    i have searched the Internet high and low and still haven't found anything that matches up to my needs

    secondly, what are your needs??
    You haven't said, and they must be unique because the the first google search I did came back with 10 c# websites with 10 quite good login examples

    Post your code here that you've written so far and we'll see if we can spot where your going wrong :)


  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭John_Mc


    pwd wrote: »
    google for the membership provider schema for mysql. This will set up all the database tables etc that you need.

    Its ODBC

    I did a login script for MySQL in ASP.net 1.1 but as already said, best off using the built in Membership functionality


  • Closed Accounts Posts: 51 ✭✭poissys


    iv already connected to my mysql database, with a net connector 5.4.1 i think, im using VS 2005.
    wheres the built in security and authentication model in vs?
    wat else will i need to do to get the login to connect to the mysql db?


  • Registered Users, Registered Users 2 Posts: 413 ✭✭ianhobo


    poissys wrote: »
    iv already connected to my mysql database, with a net connector 5.4.1 i think, im using VS 2005.
    wheres the built in security and authentication model in vs?
    wat else will i need to do to get the login to connect to the mysql db?

    What do you mean? You say you've already connected? so surely, well, you're connected?
    I don't know where you are and you haven't described it (your problem) very well.

    Could you elaborate more and post some code maybe?


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭John_Mc


    poissys wrote: »
    iv already connected to my mysql database, with a net connector 5.4.1 i think, im using VS 2005.
    wheres the built in security and authentication model in vs?
    wat else will i need to do to get the login to connect to the mysql db?

    I'm basing this on Visual Web Developer, but there's a button on the top right for website properties. You need to go in there and create Usernames and roles.
    Probably not the best description but google it or use the help function.

    I'm not sure what you mean by what else to you need to do? Once connected to the DB, run a check against the member table for the supplied username and password. If you get a match, then use a session variable to store member details and redirect to the login page.


  • Closed Accounts Posts: 51 ✭✭poissys


    thanks for the posts guys
    im using VS 2005 and connecting to mysql server, and using c# and asp.net
    i clicked on properties, but this is not proprties option with the list of rols etc is not appearing.
    i am lost!

    one big question, will it make a difference that i am using mysql server and not sqlserver, for all things membership and roles related?


    John_Mc wrote: »
    I'm basing this on Visual Web Developer, but there's a button on the top right for website properties. You need to go in there and create Usernames and roles.
    Probably not the best description but google it or use the help function.

    I'm not sure what you mean by what else to you need to do? Once connected to the DB, run a check against the member table for the supplied username and password. If you get a match, then use a session variable to store member details and redirect to the login page.


  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭John_Mc


    poissys wrote: »
    thanks for the posts guys
    im using VS 2005 and connecting to mysql server, and using c# and asp.net
    i clicked on properties, but this is not proprties option with the list of rols etc is not appearing.
    i am lost!

    one big question, will it make a difference that i am using mysql server and not sqlserver, for all things membership and roles related?

    Yes, the .Net framework Membership & Profile functionality needs SQL server 2005 DB to store the data in.


  • Closed Accounts Posts: 51 ✭✭poissys


    thanks for the input
    i need to know what i can use to get a login working with c£ and mysql?


  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭John_Mc


    I've already explained what you need to do and so have others. You should try using Google as it really can be very helpful :rolleyes:

    Setup the page to take a username and password off the user. If you're using encryption, then apply it to the credentials before connecting to the DB.

    Establish a connection to the DB, and use an SQL statement to check the members DB for a record with that Username and Password.

    If it finds a record, then the user has been verified so assign some info such as the MemberID or whatever to a session variable and redirect to the login area.

    In the login area you can check for the Session variable value and redirect to the login page if it's not valid.


  • Advertisement
Advertisement