|
You need to use DataView[^] class to sort the contents of a DataTable.
And then use the DataView as the DataSource to your DataGrid.
Michael
CP Blog [^] Development Blog [^]
-- modified at 6:57 Saturday 24th June, 2006
|
|
|
|
|
Thanks Michel, It's working. Can i assign the sorted content to the same data table.
Jey
|
|
|
|
|
How to sort contents of datatable using one or more columns.
Jey
|
|
|
|
|
+I have applicaton, i write on PocketPC 2002 Emulator, but :
+ When i press F5 , my application not show on Pocket PC, i must go to directory of my application and run it. but i can't debug my App.
+ But i press Ctrl + F5 , my application show on Pocket PC, but i can't debug my app
+ And it show Message :
Error while trying to run project: Unable to start debugging. + Pocket PC Emulator
+ I'm using VS2003, FW1.1
Help! Thanks
Please send mail to : thp_1981@yahoo.com
doremon
-- modified at 8:44 Saturday 24th June, 2006
|
|
|
|
|
sorry if this is a repost
Unlike web forms where we could set the datasource property of the combobox alias dropdownlist to the datareader and then set value member and display member .
we cannot do this directly in web forms
we need to do a loop and add the members
ComboBox1.Items.Clear()
If (dr !=null)
{
while (dr.Read())
{
ComboBox1.Items.Add(dr["Name"]);
}
}
how should we add for value members and display members if binding is through the datareader and not dataset
|
|
|
|
|
I found the solution for it myself , hope this could be usefull to someone
this is the code snippet for it , it needs a supporting class along with it
private void button1_Click(object sender, System.EventArgs e)
{
OleDbConnection dbconn = new OleDbConnection(@"Provider=microsoft.jet.oledb.4.0;data source=D:\ashishg\TEST.mdb");
OleDbCommand dbcmd = new OleDbCommand("Select idTest,NameTest from tbltest",dbconn);
OleDbDataReader reader;
dbconn.Open();
reader = dbcmd.ExecuteReader();
ArrayList temptbl = new ArrayList();
while (reader.Read())
{
temptbl.Add(new NameValue(reader["NameTest"].ToString(),reader["idTest"].ToString()));
}
dbconn.Close();
comboBox1.DataSource = temptbl;
comboBox1.DisplayMember = "NameMember";
comboBox1.ValueMember = "ValueMember";
}
the supporting class
public class NameValue
{
private string myNameMember;
private string myValueMember;
public NameValue(string strNameMember,string strValueMember)
{
this.myNameMember = strNameMember;
this.myValueMember = strValueMember;
}
public string NameMember
{
get
{
return myNameMember;
}
}
public string ValueMember
{
get
{
return myValueMember;
}
}
}
The Secret of gettting ahead is getting started
|
|
|
|
|
i want to run my c# project in a pc where visual studio.net is not setup.
how can i do it.
|
|
|
|
|
hi
install the framework on that pc , then install your project
on it
Tamimi - Code
|
|
|
|
|
thanks, but size is matter.that is very big.i want small size.
|
|
|
|
|
it is a web application ??
Tamimi - Code
|
|
|
|
|
|
You are out of luck then. A C# app cannot run without the .NET framework being installed. Unless of course you have money to burn then you can buy something like this[^].
Michael
CP Blog [^] Development Blog [^]
-- modified at 3:05 Saturday 24th June, 2006
|
|
|
|
|
i have about .net framework whice size is less than 1mb. but i can not get it.
|
|
|
|
|
|
but how a normal user install it on his pc. only for use my project.
|
|
|
|
|
|
but they are very big. can i make a setup file with .net framework and my project togather. plz help me.
|
|
|
|
|
|
|
That is the concept of .NET. If you don't want to install the .NET Framework, then don't write codes in C#. Just use the old C++.
|
|
|
|
|
put you application in a Setup Project, where you can install
the framework as on option
Tamimi - Code
|
|
|
|
|
Something Added.
If you run a application based on .Net Framework 2.0 ,but there is only 1.0 or 1.1,the application will not run ,too.The .Net Framework 2.0 is required.
No begin no end.
|
|
|
|
|
What does design pattern in winform mean?
Thanks
|
|
|
|
|
|
My best bet is about the use of design patterns in WinForm.
Best,
Jun
|
|
|
|