Community discussion forum

connection to database

  • 6 months 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.

    Post was edited on 19/05/2009 05:01:48 Report abuse
  • 6 months 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

  • 6 months 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.

  • 6 months 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.

  • 6 months 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.

  • 6 months 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).

Want to stay in touch with what's going on? Follow us on twitter!