Hi gang,
Im busy writing my firs Windows Mobile 6 Application. - I'm a beginner ok.
My first problem: When I run the app through the emulator I get an error: Database file cannot be found. - Where does the emulator look for the database? Can I copy the file there?
My connection string when running the app off my actual device is:
this.connection String = "Data Source=" + (System.IO.Path .GetDirectoryNa me(System.Refle ction.Assembly. GetExecutingAss embly().GetName ().CodeBase) + "\\Details.sdf; Persist Security Info=False"); Here it works fine.
If I run the app from the Releaase Folder under the Bin folder it works fine with the following Connection string:
this.connection String = @"Data Source=Details. sdf;File Mode=Exclusive; Persist Security Info=False";
My second question then is:
I have a data grid which data source is a datatable. the columns are: fldID, fldName, fldSurname and fdlTel.
I want to hide the fldID column. I cannot seem to access the Grid View Property nor set the widths of the columns.
I've tried the following code, but it does not change anything. It also dies not error:
// RENAMING COLUMNS IN A DATAGRID IF DATASET IS USED:
DataGridTableSt yle ts = new DataGridTableSt yle();
ts.MappingName = "tblDetails ";
// ID column style
DataGridColumnS tyle id = new DataGridTextBox Column();
id.MappingName = "ID";
id.Width = 0;
ts.GridColumnSt yles.Add(id);
// Name column style
DataGridColumnS tyle name = new DataGridTextBox Column();
name.MappingNam e = "Name";
name.Width = this.Width - name.Width - 37;
ts.GridColumnSt yles.Add(name);
// Surname column style
DataGridColumnS tyle surname = new DataGridTextBox Column();
surname.Mapping Name = "Surname";
surname.Width = this.Width - surname.Width - 37;
ts.GridColumnSt yles.Add(surnam e);
// Tel column style
DataGridColumnS tyle tel = new DataGridTextBox Column();
tel.MappingName = "Tel";
tel.Width = this.Width - tel.Width - 37;
ts.GridColumnSt yles.Add(tel);
dgItems.TableSt yles.Add(ts);
Any help please?
Thanks,
Lóan
Im busy writing my firs Windows Mobile 6 Application. - I'm a beginner ok.
My first problem: When I run the app through the emulator I get an error: Database file cannot be found. - Where does the emulator look for the database? Can I copy the file there?
My connection string when running the app off my actual device is:
this.connection String = "Data Source=" + (System.IO.Path .GetDirectoryNa me(System.Refle ction.Assembly. GetExecutingAss embly().GetName ().CodeBase) + "\\Details.sdf; Persist Security Info=False"); Here it works fine.
If I run the app from the Releaase Folder under the Bin folder it works fine with the following Connection string:
this.connection String = @"Data Source=Details. sdf;File Mode=Exclusive; Persist Security Info=False";
My second question then is:
I have a data grid which data source is a datatable. the columns are: fldID, fldName, fldSurname and fdlTel.
I want to hide the fldID column. I cannot seem to access the Grid View Property nor set the widths of the columns.
I've tried the following code, but it does not change anything. It also dies not error:
// RENAMING COLUMNS IN A DATAGRID IF DATASET IS USED:
DataGridTableSt yle ts = new DataGridTableSt yle();
ts.MappingName = "tblDetails ";
// ID column style
DataGridColumnS tyle id = new DataGridTextBox Column();
id.MappingName = "ID";
id.Width = 0;
ts.GridColumnSt yles.Add(id);
// Name column style
DataGridColumnS tyle name = new DataGridTextBox Column();
name.MappingNam e = "Name";
name.Width = this.Width - name.Width - 37;
ts.GridColumnSt yles.Add(name);
// Surname column style
DataGridColumnS tyle surname = new DataGridTextBox Column();
surname.Mapping Name = "Surname";
surname.Width = this.Width - surname.Width - 37;
ts.GridColumnSt yles.Add(surnam e);
// Tel column style
DataGridColumnS tyle tel = new DataGridTextBox Column();
tel.MappingName = "Tel";
tel.Width = this.Width - tel.Width - 37;
ts.GridColumnSt yles.Add(tel);
dgItems.TableSt yles.Add(ts);
Any help please?
Thanks,
Lóan
Comment