Hi Thank you cerberus and fruitman.

I've done the following:

Private Sub login_button_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles login_button.Click

Dim strConnectionString As String = "Provider=SQLOLEDB;Data
Source=SQLSERVER;Integrated Security=SSPI"
Dim objConnection As New OleDbConnection(strConnectionString)

 objConnection.Open()

but I get the following error at this point:


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.


On May 27, 11:59 pm, The_Fruitman <[email protected]> wrote:
> Here's an example of the flow that you need to do.  NOTE: This was
> written very quickly and there is room for refactoring and cleaning up
> the functions as well as adding error handling but the basic principal
> is what I'm trying to get across.  For this example I'm going to throw
> the results into a dataset.
>
> Private Sub login_button_Click(ByVal sender As System.Object,
> ByVal e As System.EventArgs) Handles login_button.Click
>
> Dim sqlconn As SqlConnection
> Dim sqldata As SqlDataAdapter
> Dim dsresults As New DataSet
> Dim strsql As String = "Select * From table"
>
> sqlconn = New SqlConnection("PUT YOUR CONNECTION STRING HERE")
> sqldata = New SqlDataAdapter(strsql, sqlconn)
> sqlconn.Open()
> sqldata.Fill(dsresults)
> sqlconn.Close()
>
> End Sub
>
> On May 26, 5:56 pm, jt_2009 <[email protected]> wrote:
>
> > HI everyone,
>
> > Thank you for all the info and the welcome. Couple of things:
>
> > 1. What is OP?
> > 2. I understand that the logic/concept is the same. However where I am
> > stuck is in the application of this concept.
>
> > As you can see from the above I've since attempted to do the following
> > when the button is clicked:
> > a. open a connection to sybase (using the connection string from the
> > connection string website)
> > b. I've also imported System.Data.Oledb
>
> > However this is still not working. I have tried connecting to a MSSQL
> > server instead (just easier for me as I am learning). I can add a data
> > source in VS2005 BUT I still have no idea on how to get the connection
> > to be established when the button is clicked. I must definitely be
> > missing something.
>
> > So if you would be able to assist me in this particular area that
> > would be great. Even helping me get the MSSQL connectivity working
> > upon clicking the login buttong would be a good start - I can then
> > apply the same thing to connect to say sybase.
>
> > At this stage though I need someone to take my hand and walk me
> > through (unfortunately). Once again I understand the concept is the
> > same no matter what db/type of app but practically speaking I can't
> > get it working.
>
> > Thanks again for your time.
>
> > On May 22, 5:32 pm, Cerebrus <[email protected]> wrote:
>
> > > Correct, but the OP is referring to Login suite of controls which are
> > > exclusively ASP.NET. Clearly, it was a lapse on the part of the OP not
> > > to mention the type of application at the outset.
>
> > > BTW, Welcome to the Group! ;-)
>
> > > On May 22, 1:33 am, Neo <[email protected]> wrote:
>
> > > > dude,
> > > > even if u are developing a window app (.exe), the logic behind the
> > > > authentication remains the same,
> > > > i.e. :
> > > > if the user name and password exists in db,
> > > > load them in your app, using ADO.NET and compare it with the user
> > > > input. simple :)
>
> > > > On May 20, 6:35 am, jt_2009 <[email protected]> wrote:
>
> > > > > Hi Keidrick
>
> > > > > Thank you for your reply, but I think the login control is for web
> > > > > based applications? I am building an exe - please correct me if I am
> > > > > wrong.
>
> > > > > On May 20, 12:04 am, KeidrickP <[email protected]> wrote:
>
> > > > > > I would also recommend using the .net login  controls.
> > > > > > Instead of just regular text boxes.
>
> > > > > >http://msdn.microsoft.com/en-us/library/ms178329.aspx
>
> > > > > > On Tue, May 19, 2009 at 8:50 AM, The_Fruitman
>
> > > > > > <[email protected]> wrote:
>
> > > > > > > The programming logic remains the same no matter what database 
> > > > > > > you're
> > > > > > > connecting to.
>
> > > > > > >http://www.google.com/search?hl=en&q=connect+to+database+in+vb.net&aq...
>
> > > > > > > The connection string can be found here:
> > > > > > >http://connectionstrings.com/sybase-adaptive
>
> > > > > > > On May 18, 11:04 pm, jt_2009 <[email protected]> wrote:
> > > > > > >> 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.
>
> > > > > > --
> > > > > > Keidrick Pettaway
>
> > > > > >http://kpettaway.com-Hidequotedtext-
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -

Reply via email to