connection to database

vb.net , database , loginform Melbourne, Australia
  • 11 years ago

    Hi I am new to vb.net.

    I am creating a login form and require the form to validate the username and password from a sybase ASE database. I was wondering if anyone here knows how to do that?

    Thank you . I am doing this using VS 2005.

  • 11 years ago

    On button click u check that if username and password of that user is correct or not..U can do it by querying into database and check that if username and password is correct or not...

    this is the way we can create sybase string in app.config for windows appl

  • 11 years ago

    Hi Virai

    Thank you for the reply. I think perhaps I wasn't clear enough. I know where to start verifying the uname and pword (i.e on the on click event).

    What i do not know how to do is, establish a connection to the sybase database/server and then querying it for the valid uname and pword. I've read about some imports and connection strings etc etc but I've not been able to match them all up.

  • 11 years ago

    Hi Virai

    Thank you for the reply. I think perhaps I wasn't clear enough. I know where to start verifying the uname and pword (i.e on the on click event).

    What i do not know how to do is, establish a connection to the sybase database/server and then querying it for the valid uname and pword. I've read about some imports and connection strings etc etc but I've not been able to match them all up.

  • 11 years ago

    Hi just an update:

    I've coded this:

    Private Sub login_button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles login_button.Click
        Dim sybase_conn As New OleDb.OleDbConnection
    

    sybaseconn.ConnectionString = "Provider=Sybase.ASEOLEDBProvider.2;DSURL='file://c:\sybase\ini\sql.ini?SQLMIDOFFOPC1';Data Source='myServer';Initial Catalog=myDatabase;User Id=username;Password=password" sybaseconn.Open() MsgBox("Database is now open") sybase_conn.Close() MsgBox("Database is now closed")

    But I get this error:

    An unhandled exception of type 'System.Security.SecurityException' occurred in System.Data.dll

    Additional information: Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

  • 11 years ago

    how to use MS EXCEL 2003 as the database for VB.net 2008

    I have 2 columns 1.serial no 2.Items

    I need to add the serial nos in combo box and based on the selection in combo box corresponding Items should display in a label control.

    Pls reply.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Linux is only free if your time has no value” - Jamie Zawinski