thank you. I know the command. I just want these 3 columns.
bacem smari
Posts
-
using listview control in smart device -
using listview control in smart devicethank you for the information. I think that you didn't understand my code very well. it's the datatable that i am getting the columns form. every column must appear on the listview. Can you help me? thank you.
-
using listview control in smart deviceHi , This is the code that i am using. It indicates no errors but my listview isn't filled with the result of the querry. Can you help me.
private void button1_Click(object sender, EventArgs e)
{
string wCS = @"Data Source =\Storage Card\ModeDifféré\BaseGmaoLocale.sdf;";
SqlCeConnection sqlceconn = new SqlCeConnection(wCS);
SqlCeCommand command = sqlceconn.CreateCommand();
command.CommandText = "SELECT [ID],[Magasin],[qtyonhand] from stocks where ID like @txt";
SqlCeDataAdapter adapter = new SqlCeDataAdapter(command);
SqlCeParameter txt = new SqlCeParameter("@txt", SqlDbType.NVarChar);
txt.Value = textBox1.Text;
command.Parameters.Add(txt);
DataSet ds = new DataSet();
adapter.Fill(ds);
string[] str = new string[ds.Tables[0].Columns.Count];
foreach (DataRow dr in ds.Tables[0].Rows)
{
for (int col = 0; col <= ds.Tables[0].Columns.Count-1; col++)
{
//filling the array of string
str[col] = dr[col].ToString();
}
ListViewItem ii;
ii = new ListViewItem(str);
this.listView1.Items.Add(ii);
}}
-
using listview control in smart devicehi, thank you but i am trying to fill the listview with the result of a querry. Can you help me?
-
using listview control in smart devicehi everybody, I am trying to create a multicolumn listview knowing that it is not possible to do with a listbox I have 2 questions: the first is how can i display the header of the columns? the second is how can i get data from a data base .sdf and display it on the colomuns of my listview? Thank you in advance
-
Multicolumn listbox in smart device applicationGood morning, I am working on a smart device application. I want to create a listbox with 3 columns which get there data from a local database .sdf I tried the following code but an exception occurred.
private void button1_Click(object sender, EventArgs e)
{
string wCS = @"Data Source =\Storage Card\ModeDifféré\BaseGmaoLocale.sdf;";
SqlCeConnection sqlceconn = new SqlCeConnection(wCS);
SqlCeCommand command = sqlceconn.CreateCommand();
command.CommandText = "SELECT [ID]+\" \"+[Magasin]+\" \"+ [qtyonhand] AS IMQ from stocks where ID like %@txt%";
SqlCeDataAdapter adapter = new SqlCeDataAdapter(command);
SqlCeParameter txt = new SqlCeParameter("@txt", SqlDbType.NVarChar);
txt.Value= textBox1.Text;
command.Parameters.Add(txt);
DataSet ds = new DataSet();
adapter.Fill(ds);
listBox1.DataSource = ds.Tables[0];
listBox1.DisplayMember="IMQ";
}this is the exception
there is an error parsing the querry. [token line number =1, token line offset=77, Token in error = %]
thank you in advance.
-
how to insert a new line in a table of a .sdf file smart device applicationi open the table from visual studio after closing the application and i check if there is a new line inserted.
-
how to insert a new line in a table of a .sdf file smart device applicationthe error was repaired but nothing happened in data base. There is is no line inserted.
-
how to insert a new line in a table of a .sdf file smart device applicationthank you but for the line:
SqlCeCommand command2 = sqlceconn.CreateCommand(insertString,sqlceconn);
the following error occurs: Error 1 No overload for method 'CreateCommand' takes '2' arguments C:\Users\Admin\Documents\Visual Studio 2008\Projects\GMAOMobile\ModeDifféré\Energie.cs 107 41 ModeDifféré what is the problem?
-
how to insert a new line in a table of a .sdf file smart device applicationthis is the code:
private void menuItem4_Click(object sender, EventArgs e)
{
DateTime t = DateTime.Now;
string wCS = @"Data Source =\Storage Card\ModeDifféré\BaseGmaoLocale.sdf;";
SqlCeConnection sqlceconn = new SqlCeConnection(wCS);
SqlCeCommand command2 = sqlceconn.CreateCommand();
command2.CommandText = "INSERT INTO compteurs2 ([com], [quantite],[datequantite] ) Values(@com,@qtte,@dat)";//Add the parameters SqlCeParameter com = new SqlCeParameter("@com", SqlDbType.NVarChar); com.Value = comComboBox.SelectedItem.ToString(); command2.Parameters.Add(com); SqlCeParameter qtte = new SqlCeParameter("@qtte", SqlDbType.Float); qtte.Value = float.Parse(textBox1.Text); command2.Parameters.Add(com); SqlCeParameter dat = new SqlCeParameter("@dat", SqlDbType.Float); dat.Value = t; command2.Parameters.Add(dat); command2.ExecuteNonQuery(); }
and i didn't see any exception.
-
how to insert a new line in a table of a .sdf file smart device applicationthank you for your suggestion but it still doesn't work.
-
how to insert a new line in a table of a .sdf file smart device applicationHi everybody, I am trying a smart device application. the problem is after i execute a querry that should insert a new line in a table, i go to check if the line existe really in the table then i don't find it. this is the code i used. Thank you for your help in advance.
private void menuItem4_Click(object sender, EventArgs e)
{
string wCS = @"Data Source =\Storage Card\ModeDifféré\BaseGmaoLocale.sdf;";
SqlCeConnection sqlceconn = new SqlCeConnection(wCS);
SqlCeCommand command2 = sqlceconn.CreateCommand();
command2.CommandText = "INSERT INTO compteurs2 ([com], [quantite],[datequantite] ) Values(@com,@qtte,SYSDATE)";
command2.ExecuteNonQuery();//Add the parameters SqlCeParameter com = new SqlCeParameter("@com", SqlDbType.NVarChar); com.Value = comComboBox.SelectedItem.ToString(); command2.Parameters.Add(com); SqlCeParameter qtte = new SqlCeParameter("@qtte", SqlDbType.Float); qtte.Value = float.Parse(textBox1.Text); command2.Parameters.Add(qtte); }
-
sending the value of a parameter in a form to another form smart devicethank you for your help, But i am working on a mobile application and it is not a web application. I found finallay the solution for the problem. It was very simple: add a parameter to the constructor of the form and call it with this parameter.
-
sending the value of a parameter in a form to another form smart deviceHi; i am working on a mobile application with csharp. I want to know how can i use a parameter related to a form in another form. what can i do. thank you for your help.
-
Storage card in the emulatorthanks to tunisien86 that gave an idea to solve the problem this is the link you can see it if you have problems. thank you. http://social.msdn.microsoft.com/Forums/en-US/vssmartdevicesvbcs/thread/0f32993e-5b16-43b4-b7b6-09a3f66eb2f2/
-
Storage card in the emulatorHi, I think that you gave me the idea without precision and i thank you. However i don't know how to do it. Can you show me how to do the copy please. thank you in advance. :sigh:
-
Storage card in the emulatorHi, I am a novice in developing mobile applications. The problem is with my mobile database which is saved in the storage card of the emulator. When i execute my program the following error occurs:
Acces to the database file is not allowed. [File name = \Storage Card\ModeDifféré\BaseGmaoLocale.sdf]
I have to keep you informed that the connexion string that i made is the following
@"Data Source =\Storage Card\ModeDifféré\BaseGmaoLocale.sdf;"
So what is the problem. How can i process to solve this problem. thank you for your help.