Getting a file path

  • Thread starter Thread starter Diego F.
  • Start date Start date
D

Diego F.

Hi, I'm having troubles with a file path in a CF app. I need to load a XML
file with a dataset and I need the full path. I'm trying with the
System.IO.Path class (method GetFullPath(string file)). I tried first in a
Windows app and it works, but not in the SDA app.

Any help please?

Diego F.
 
code for current path of running program
System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().Co
deBase.ToString())+"\\";



just add "file.ext" and you are done...



Cheers Floris Briolas
 
Thanks!!

Now the problem is that I can't load the dataset as I do in a Windows forms
app. If I use ds.ReadXml and I try to display the info in a datagrid it is
empty.

Do I need to do more additional steps?


Diego F.
 
The fact is I'm not sure if the dataset is empty or not. As the datagrid
doesn't have the DataMember property, it looks compressed, but I can't
expand it to see if it's really empty or not.

Diego F.
 
I just had to specify the datasource. Instead of just the dataset name, It's
necessary to put the name of the table.

I had: datagrid1.DataSource = ds;

and now: datagrid1.DataSource = ds.Tables["users"];

This must be because there is no DataMember property

Diego F.
 
Back
Top