|
Sonia - you asked this question below. Don't repost questions, continue threads instead as this is just plain rude.
|
|
|
|
|
You can write several statements and use logical operators to return the value according to your filter requirements.
Logical Operators in C#[^]
|
|
|
|
|
person pp = obj.Find(delegate(person p) { return p.name == "abc" && BUY_A_BLOODY_C#_BOOK_FOR_THE_HUNDREDTH_TIME; });
|
|
|
|
|
Possibly a little too subtle. I still don't think she'll get it.
|
|
|
|
|
Yes, I agree. I still have a lot to learn to achieve your level of sarcasm and wit
|
|
|
|
|
J4amieC wrote: Yes, I agree. I still have a lot to learn to achieve your level of sarcasm and wit
Oh I don't know. That post made me laugh. I even showed it to people.
|
|
|
|
|
hi
i m newbie to C#.net , i have to create a usercontrol with a gridview in it i have to set its datasource to the dataset used in its parent form to do this i am setting properties at the usercontrol like this :
[System.ComponentModel.ComplexBindingProperties("DataSource","DataMember")]
public partial class UserControl1 : UserControl
{
public object DataSource
{
get
{
return dgvSearch.DataSource;
}
set
{
dgvSearch.DataSource = value;
}
}
public string DataMember
{
get{ return dgvSearch.DataMember ;}
set { dgvSearch.DataMember = value; }
}
public UserControl1()
{
InitializeComponent() ;
}
and from parent form i am setting the datasources for my parent control
BindingSource datasource;
DataSet data=new C21_SecurityDataSet() ;
DataTable dt = data.Tables.Add();
userControl11.DataSource = datasource = new BindingSource (data, "users");
usercontrol11.dataMember="users"
but no data displayed at my user control plz help me out
thanks
|
|
|
|
|
I have the column of type string in the database
Following is the data in that column
1
2
11
12
21
abc
If i sort the table with the help of this column then the output come in the following manner
1
11
12
2
21
abc
can i improve the order actually i want the output like 1 2 11 12 21 abc
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Why not add order by [column name] ASC
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
You could, but only with some extremely fancy logic. It's a string, so you have to abide by the rules of strings. Off the top of my head, I would think that you would have to remove the numeric type strings and sort them independently of the non-numeric strings and then combine the two together.
|
|
|
|
|
i can use the union query to first select the numeric and then an another union query to sort alphanumeric.
Am i doing right?
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Sonia Gupta wrote: i can use the union query to first select the numeric and then an another union query to sort alphanumeric.
Am i doing right?
For the love of God Sonia, just try it. I'm not going to type your code out for you.
|
|
|
|
|
Convert the data type of the column on the fly using convert or cast then reorder the converted column using ORDER BY.
Make sure the converted type is integer!
|
|
|
|
|
Hi,
I don't think SQL offers the required ordering.
The "natural sort order" as used for file names by Windows Explorer is available through
P/Invoke, so you can implement an IComparer interface like this:
using System.Runtime.InteropServices;
public static int Compare(string s1, string s2) {
if (s1!=null && s2!=null) return StrCmpLogicalW(s1, s2);
else return string.Compare(s1, s2, true);
}
[DllImport("shlwapi.dll", CharSet=CharSet.Unicode, ExactSpelling=true)]
private static extern int StrCmpLogicalW(string s1, string s2);
I do not know how you could apply the above to database-based data; I would guess
you need to first fill a DataTable, then somehow get that sorted using the IComparer object.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Ordinarily I'd say left pad the numerics with SPACEs then sort, but SQL Server doesn't appear to have a PAD function? I thought Oracle did. What Database system are you using?
Some ideas for SQL Server:
select * from PadTest order by
REPLICATE(' ',8-LEN(X))+X
or
select * from PadTest order by
case ISNUMERIC(X)
when 1 then REPLICATE(' ',8-LEN(X))+X
else X end
modified on Friday, March 7, 2008 12:57 PM
|
|
|
|
|
Hi,
I have a windows form with Ten Textboxes and I want to set text with Zero "0" using foreach loop.
Kindly tell me the method.
Thank you in advance
(Riaz)
|
|
|
|
|
You can iterate through the controls on your form using Controls property and check whether the current control is textbox or not. If yes, set it's text to 0.
|
|
|
|
|
Hi,
I have to secure the HTTP communication between a client and a server which are placed on separate machines. Both client(C# appl.) and server(Java appl.) are desktop applications. I know that I have to create SSL on HTTP in order to obtain a communication over HTTPS. I don't know how to create the certificates and how to handle them. If you have any suggestions/links, write them here, please!
Thank you,
L.P.
|
|
|
|
|
The SSL certificate depends on what web server you are running. Try to Google "how to create https certificate" and you'll probably find an answer.
Hogan
|
|
|
|
|
Hi all,
The problem is I am unable to generate the an alert/popup from a windows service.
Can any body has got the solution for generating it.
Please help. Its urgent.
Thanks in Advance
Ankur
|
|
|
|
|
You can't!
Write to event log...
|
|
|
|
|
Thanks for the reply ..
but how does the general pop up ex: system connection, scan and etc pop up comes.
I think these are all services running in the system which on detecting the required thing generates an alert.
Isn't it???
Thanks
Ankur
|
|
|
|
|
It can be done in round round way..
1) Create another application ie form application and create a property that will be displayed as the message.
2) When you require to show the message create the object of this Form and set the property to the message you want and call the Show() Method.
3) Now go to your service right click > Properties > In the first tab you will find some check box called "Allow the service to interact with desktop") and restart the service.
Note : It is highly discouraged to set the option "Allow the service to interact with desktop".
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
following is the code , i am using for the List class.
I am facing a problem regarding Find Function
Please help .
public person(string nam , int ag)<br />
{<br />
this.age = ag;<br />
this.name = nam;<br />
}<br />
<br />
List<person> obj = new List<person>();<br />
obj.Add(new person("abc",22));<br />
obj.Add(new person("ggbc1",23));<br />
obj.Add(new person("ccc2",10));<br />
obj.Add(new person("cabc3",12));<br />
obj.Add(new person("bbbc4", 6));<br />
<br />
obj.Find(delegate(person p) { return p.age = 12; });
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
and the problem is...... ???
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|