|
-
Jun 10th, 2007, 08:06 PM
#1
Thread Starter
Hyperactive Member
SQl Connection Problem
I am now writting new app and use the VB class below to connect the db but I am getting Path error. Could anyone help. I am using the emulater now not on the device.
Code:
Imports System.Data.SqlServerCe
Public Class ShiftManagerProDB
Public Shared Function GetConnected() As SqlCeConnection
Return New SqlCeConnection(GetConnectionString)
End Function
Public Shared Function GetConnectionString() As String
GetConnectionString = "Data Source= C:\My Documents\ShiftManagerPro.sdf;persist security info=False;"
End Function
End Class
Moreover I generated strongly typed dataset using two tables, I am not able to drag the table onto the datagrid because the dataset shows both tables and when I drag one it shows on data from that one. Can I get help on how to go about it. thanks
-
Jun 11th, 2007, 01:10 AM
#2
Frenzied Member
Re: SQl Connection Problem
Hi,
the device has no idea of c:\ etc - you need to put your database on the device, say in 'my documents' and open \My Documents\ShiftManagerPro.sdf
Pete
-
Jun 11th, 2007, 06:23 AM
#3
Thread Starter
Hyperactive Member
Re: SQl Connection Problem
 Originally Posted by petevick
Hi,
the device has no idea of c:\ etc - you need to put your database on the device, say in 'my documents' and open \My Documents\ShiftManagerPro.sdf
Pete
Hi Pete I am still get error message that "the db could not be found check the path" the device is not connect, I am using the pc emulator, could you help me the best way of creating connection and if you could me on my second question on creating typed dataset with 2 tables. Thanks
Last edited by wiadus; Jun 11th, 2007 at 06:31 AM.
-
Jun 11th, 2007, 06:45 AM
#4
Frenzied Member
Re: SQl Connection Problem
Hi,
where have you put the database on the emulator - you have copied it to the emulator haven't you?
Pete
-
Jun 11th, 2007, 09:50 AM
#5
Thread Starter
Hyperactive Member
Re: SQl Connection Problem
 Originally Posted by petevick
Hi,
where have you put the database on the emulator - you have copied it to the emulator haven't you?
Pete
No pete, I am new to mobile app so I just hit deploy and set emulator. Pls help me out. Thanks
-
Jun 11th, 2007, 09:58 AM
#6
Frenzied Member
Re: SQl Connection Problem
Hi,
have you got a device, or just the emulator? You are always better testing on the emulator if you can.
If you add the '.sdf' file to your application, and set to 'copy to output if newer' on properties, it should copy with your app. It will copy to the same folder as your app (IIRC), so you need to open \Program Files\appname\ShiftManagerpro.sdf
HTH
Pete
-
Jun 12th, 2007, 07:25 AM
#7
Thread Starter
Hyperactive Member
Re: SQl Connection Problem
 Originally Posted by petevick
Hi,
have you got a device, or just the emulator? You are always better testing on the emulator if you can.
If you add the '.sdf' file to your application, and set to 'copy to output if newer' on properties, it should copy with your app. It will copy to the same folder as your app (IIRC), so you need to open \Program Files\appname\ShiftManagerpro.sdf
HTH
Pete
Thank you very mach pete, I have got the path now but I would be grateful if you could help on this problem. I have a datagrid which I would like to display data from two tables but I am finding it difficult to use a typed dataset. Any help.
-
Jun 12th, 2007, 12:13 PM
#8
Frenzied Member
Re: SQl Connection Problem
Hi,
can you not just bind it to a datasource?
Pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|