Results 1 to 7 of 7

Thread: Modulate and Query...

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2007
    Location
    Nottingham
    Posts
    53

    Modulate and Query...

    I got stuck again. Using VB.net I'm trying to develop an application with Windows CE 5.0 that access a database to get a load of information and display it. Why can't I put my connection string into a module? The connection string is going to change once I've finished the program and as I'm going to have to connect to, and close my connection to the database a lot I don't want to have to change hundreds of instances of the string when I should (in theory) just be able to change the module... right? So that's my first problem... Getting the open database function into a module.

    My second is that I need to query what's been entered into a text box, against the database (the entered UserName against the fullName field in the tbleEmloyees table) I don't seem to be able to just call a SELECT statement to compare the data, so how do I do this?

    This is what I have so far...

    Code:
    Imports System.Data.SqlServerCe
    
    Public Class Drivers
        'Global Variables
        Dim userName As String
        Dim password As String
    
        Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
            'save the entered username into a variable
            userName = tbUserName.Text
            'save the entered password into a variable
            password = tbPassword.Text
    
            Dim jitDatabase As New SqlCeConnection("Data Source = My Documents\JIT.sdf")
            jitDatabase.Open()
    
        End Sub
    End Class
    Again, thankyou ever so much!

    Pzy
    Last edited by Pzykotik; Aug 9th, 2007 at 05:38 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width