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...
Again, thankyou ever so much!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
Pzy




Reply With Quote