|
Now please stop removing your messages when solved, it is against the forum guide lines, as it results in unreadable threads. See here[^].
|
|
|
|
|
Have you tried to disable any firewalls that may be running on the client computers?
People are more violently opposed to fur than leather because it's safer to harass rich women than motorcycle gangs
|
|
|
|
|
Hi,
I'm facing a problem to fetch data rows from a child table using data set and xml file ,
using VS2005 and created the data set and tables using the wizard.
Please consider the following scenario:
TABLE1 - InstalledProgramInfo
- Name [string , Key]
- UninstallSequenceNumber [int]
TABLE2 - AdditionalBackupInfo
- Name [string , Key]
- Source [string , Key]
- Destination [string , Key]
Relation - InstalledProgramInfo_AdditionalBackupInfo (Name -> Name) , Relation type (one to many).
The XML file content is as follow:
<InstalledProgramInfo>
<Name>AAA<</Name>
<UninstallSequenceNumber>0</UninstallSequenceNumber>
<AdditionalBackupInfo>
<Name>AAA</Name>
<Source>C:\SourceTest</Source>
<Destination>C:\DestTest</Destination>
</AdditionalBackupInfo>
<AdditionalBackupInfo>
<Name>AAA</Name>
<Source>C:\SourceTest1</Source>
<Destination>C:\DestTest1</Destination>
</AdditionalBackupInfo>
</InstalledProgramInfo>
The code is as follow (The name of the data set is AppConfigurationDataSet):
AppConfigurationDataSet DataSet = new AppConfigurationDataSet();
DataSet.ReadXml("AppConfiguration.xml");
InstalledProgramInfoDataTable Table = (InstalledProgramInfoDataTable)DataSet.Tables["InstalledProgramInfo"];
foreach(InstalledProgramInfoDataRow CurrentRow in Table.Rows)
{
foreach(DataRow NestedRow in CurrentRow.GetChildRows("InstalledProgramInfo_AdditionalBackupInfo"))
{
DoSomething();
}
}
Anyone?
With best regards,
Eli
|
|
|
|
|
Good morning everybody,
I develop a csharp smart device application.I tried to connect my forms to a local database that i was created.Going to Data->add new data source,i see that my database is connectionstring is like that:
Data Source=.\BaseGmaoLocale.sdf;
When I try to connect to it with my code:
string chcc = @"Data Source=.\BaseGmaoLocale.sdf;";
SqlCeConnection sqlceconn = new SqlCeConnection(chcc);
Always when running,it generates an error telling me that it can't found the path to my database.
I used this link:
http://www.connectionstrings.com/sql-server-2005-ce[^]
I tried with the full name of the database but still the same error:
string chcc = @"Data Source = C:\\Users\\Admin\\Documents\\Visual Studio 2008\\Projects\\GMAOMobile\\ModeDifféré\\BaseGmaoLocale.sdf;";
SqlCeConnection sqlceconn = new SqlCeConnection(chcc);
Thank you a lot for all u suggestions
|
|
|
|
|
Are you deploying the database on the device? (I'd be amazed that it would be at C:\\Users\\Admin\\Documents\\Visual Studio 2008\\Projects\\GMAOMobile\\ModeDifféré\\BaseGmaoLocale.sdf on your device
|
|
|
|
|
Hi,
No i tried the application with the emulator.
regards
|
|
|
|
|
Well have you deployed it on the emulator then? The emulator does not have access to your local file system. You should copy the database to the device, whether it is an emulator or a real device. I forget how it's done, but you should include your DB file in your project, select properties, and choose some like 'deploy' in the file properties.
|
|
|
|
|
Hi,
As I read,I go to the emulator's file menu->configure.. I added the shared file:\\Admin-PC\GMAOMobile
I added the path in my code as i found in the data->add data source
string chcc = @"Data Source=.\BaseGmaoLocale.sdf";
SqlCeConnection sqlceconn = new SqlCeConnection(chcc);
But still not working
I feel really crazy about this error
any help
regards
|
|
|
|
|
You really have to copy the file to the emulator, not share the file with the emulator. Since your path indicates that it is in the current directory, copy it to the directory where your program resides.
The emulator also doesn't come with SQLCE, you will have to deploy it also, but I suppose the IDE does this for you ( you do have a reference to System.Data.SQLServerCe, do you?)
Have a llok at this tutorial: http://dotnetperls.com/sqlce-database-use[^]
|
|
|
|
|
Hi,
I tried with the physical path of my database
string chcc = @"Data Source = C:\\Users\\Admin\\Documents\\Visual Studio 2008\\Projects\\GMAOMobile\\ModeDifféré\\BaseGmaoLocale.sdf;";
SqlCeConnection sqlceconn = new SqlCeConnection(chcc);
but not still not working.
Concerning u note,I don't understand what u mean by:
The emulator also doesn't come with SQLCE, you will have to deploy it also,
For the reference,I have the reference System.Data.SQLServerCe
Thanks for u help
|
|
|
|
|
Yes that's the physical path on your PC, but the program will not run on your PC, will it?
The Emulator, or your smart device comes empty: it does not have the .net framework, it does not have SQL CE, it has just the OS, and some manufacturer or Microsoft supplied programs. .Net and SQLCE come in .cab files, supplied by Microsoft. When you copy your program to the emulator or to the the phone, Visual studio creates a deployment package that contains all these files(choosing the right ones for the processor type of your device), and copies this deployment package to the device. The emulator or the smart device will not have access to any files on your pc. So if your database file is stored somewhere on your PC, the emulator will not be able to reach it;
The database file probably does not exist on your PC either, except if you have created it using SQL CE for PC; The only thing that exists is an empty sdf file in the development environment. You've probably created the data connection in the ide, and it's now sitting in the 'server explorer' pane (the left pane in visual studio). Now add this data connection to your project (probably the right pane).
From then on, everything should be automatic. Visual studio will build the packages, select the cab files, copy them to your device, start the remote debugger....
Now, You've probably messed around so long with your project that a lot of the settings are messed up.
Start afresh, create a new project, a new database, and don't use any of the settings from the other project. Follow the tutorial exactly, and try to understand what is happening at each step. Once you have the tutorial running, create another new project, and this time use your specifications and your requirement. Test each step along the way, and if something does not work, check what you have done differently from the tutorial.
|
|
|
|
|
Hi,
Thanks a lot for u explanation.I vote for it.I follow u steps and the link bellow:http://msdn.microsoft.com/en-us/library/aa289160%28VS.71%29.aspx#grfvsdcopyingfilestotheemulator[^]
But still the same problem.I am fed up really of this exception.
I want to mention that when going to visual studio:menu tools->connect to device->connect and then to start->Progams->File explorer I found in the storage card my shared file \\Admin-PC\GMAOMobile.Can I use the storage card option to connect to my database??
thanks
|
|
|
|
|
I suppose you mean GMAOMobile.Cab. That's not the database. It's the cab file containing your program.But yes, nothing prevents you from putting the database on the storage card. Copy the DB (the sdf file) from the pc to the storage card, and, and refer to it as \\Storage card\GMAOMobile.sdf. (Don't know what your storage card is called, but it should appear as a directory in your mobile device).
|
|
|
|
|
|
Just out of curiosity, what version of visual studio are you using? (The instructions you pointed to were for visual studio 2003)
|
|
|
|
|
Hi,
I use Visual Studio 2008.
regards
|
|
|
|
|
|
hello everyone
I would like to know how to convert vb.net code in c#.
thanks
|
|
|
|
|
Google[^] not working where you are?
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
Thank you for your reply, but after a rechreche on google, I found many solution, but I preferred to have the opinion of someone who already work in this direction, and thank you again.
|
|
|
|
|
|
|
The SharpDevelop IDE can convert those files automatically
I are Troll
|
|
|
|
|
I downloade SharpDevelop but I don't now how to use it ?
thank .
|
|
|
|
|
Open your solution, open the file that you want to convert, and select the menu "Convert code to" from the "Tools" menu
I are Troll
|
|
|
|