|
If he does I'll kick his skinny white ass.
|
|
|
|
|
I'm using a PropertyGrid in C# to display ConfigurationElements. I have an implementation of a ExpandableObjectConverter TypeConverter to display the sub-elements (with descriptions) in the property grid.
E.g.
Item 1
First sub-item
Item 1 ID
Second sub-item
x
Item 2
First sub-item
Item 2 ID
Second sub-item
x
...
I want to display the sub-elements in a specific order - not alphabetically (e.g. The ID before the other sub-elements).
Could anyone please tell me how to specify the ordering? (I've Googled it, looked at CodeProject articles, looked on MSDN - where I (momentarily) thought I'd found a solution using SortProperties - which turns out not to be overridable.)
Any ideas would be much appreciated.
P.S. I tried posting this in the Quick Answers - but I can't see my post (so please don't flame me for cross-posting if you can see it in both places).
"...there's what people want to hear, there's what people want to believe, there's everything else, THEN there's the truth!" - New York D.A., The International
|
|
|
|
|
Link to QA post[^]
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Thanks Dave, but if I view all questions under QA (All Questions | Latest) I don't see it. Am I being a dumbass?
"...there's what people want to hear, there's what people want to believe, there's everything else, THEN there's the truth!" - New York D.A., The International
|
|
|
|
|
Right now I see it second entry on page 2, check your filters on the right hand side!
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Thanks Dave. I can see it now.
"...there's what people want to hear, there's what people want to believe, there's everything else, THEN there's the truth!" - New York D.A., The International
|
|
|
|
|
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Hola!
I want to use a regexp, and I've partly came up with it, but I cannot get the last bit to work. The regular expression I'm currently using looks like this:
(\d{3}\s\d{2})(\s[A-Z])|(\d{5})(\s[A-Z])
And I want to use it extracting a Swedish zip code which looks as follows:
111 11 City
or
11111 City
The reason I have the letter in the Regexp is that I don't want any other number sequence.
So the question is:
Is there a way to just get the numbers from my regexp, some kind of split or something like that?
All the best
Simon
|
|
|
|
|
You already have the number part wrapped in parenthesis - which implies a capture group - so you already have it.
I suggest you download expresso - a very helpful tool for debugging regex - google will be your friend in finding it.
Having tested your regex using expresso. I can give you 2 pointers:
1) Name your capture for numbers - it makes it alot easier to extract just the numbers:
(?<numbers>\d{3}\s\d{2})(\s[A-Z])|(?<numbers>\d{5})(\s[A-Z])
2) You're only testing for upper case chars - so your regexp only captures as far as the 'C' in city. Fix this like so:
(?<numbers>\d{3}\s\d{2})(\s[A-Z])|(?<numbers>\d{5})(\s[A-Za-z])
|
|
|
|
|
Cheers for your reply J4amieC!
However it doesn't work, Visual Studio doesn't seem to recognize the use of ?<numbers>
I know the part of the letter, but that was just there to distinguish the zip code from any other kind of row of numbers. But if I manage to extract the actual zip code by using numbers, then I could do the same with the letters (City) I presume, so that would be great...If I only could get Visual Studio to understand what I'm trying to achieve
Another question as well...My Visual Studio doesn't want to work with me on a different point too. It won't accept the use of ^ (like in ^\d{2,5}).
I'm using Visual Studio 2005 by the way,,,maybe that's why this is giving me a hazzle?
All the best
Simon
|
|
|
|
|
Why not a simple: \d\d\d\s?\d\d ?
|
|
|
|
|
Hello PIEBALDconsult
I tried using your example, but the thing I want to avoid happened. I just want to get 123 45 or 12345 from a zip code, but \d\d\d\s\d\d and \d\d\d\d\d returns any line of numbers 1234567890. I know it's easy to solve with ^ in the start, but since my Visual Studio wont let me use ^ I have to go the long way around,,,if there's a long way around, I'll probably end up on dark forest paths and eventually plumb into a deep dark hole.
Cheers for the suggestion anyways
|
|
|
|
|
skelmannen wrote: Visual Studio wont let me use ^
What?
|
|
|
|
|
Give this regex a try:
(^|\D+)(?<postalCode>\d{3}\s?\d{2})\s(?<city>[A-Za-z]+)
The first group checks for the beginning of the line or a non-digit character. This should prevent the regex from picking up lines with more than 5 digits. The "postalCode" group will have your Swedish zip code and "city" will have the city name.
|
|
|
|
|
Cheers Kythen, I'll try that one and hope it's working.
And PIEBALDconsult,,,just what I wrote,,,probably just a bug on my machine, still very annoying.
Take it easy
|
|
|
|
|
Hi,
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.
|
|
|
|
|
Are we still going about this?
What you see in the emulator as 'Storage Card', is the directory that you have shared from your PC when you set up the emulator settings.
In order to use the database on your emulator (or an device for that matter) you should copy this file somewhere in the '/' hierarchy of your device (the other drive you see in mobile explorer), and refer to it accordingly.
|
|
|
|
|
Hi,
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.
|
|
|
|
|
|
Hello,
I am developing a GMAO csharp smart device application.I am in the step of adding checkboxs dynamically:
I have two tables:Travaux (Works in English) and Actions related by the two fields Nature (table Travaux)and typeTravail(Table Actions).If the user enters the number of the work(NBT the pk_Travaux),the system adds a number of checkboxs equal to the steps that should the user follows to accomplish(field step in Actions table).After that,the user has the possibility to check or not the step if he did it.All the traitments will be done dynamically with the database
My select statement is:
select Etape from Action where ((Travaux.NBT=textbox1.text) and (Travaux.Nature=Action.TypeTravail))
Equal of what this select returns,it will add dynamically checkboxs
I wait for u suggestions
Regards
|
|
|
|
|
Hi,
After some search,I elaborate this code that still annoying me with some errors:
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 NBT, Nature from Travaux where NBT=@NBT ";
string s1 = textBox1.Text;
SqlCeParameter NBT = new SqlCeParameter("@NBT", SqlDbType.NVarChar);
NBT.Value = s1;
command.Parameters.Add(NBT);
SqlCeDataAdapter adapter = new SqlCeDataAdapter(command);
DataSet ds = new DataSet();
try
{
adapter.Fill(ds, "SQL Temp Table");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
foreach (DataRow da in adapter)
{ string s = adapter["Nature"]; }
if ((ds.Tables.Count > 0) && (ds.Tables["SQL Temp Table"] != null))
{
MessageBox.Show("Number of row(s) - " + ds.Tables["SQL Temp Table"].Rows.Count);
if (ds.Tables["SQL Temp Table"].Rows.Count > 0)
{
MessageBox.Show("Numéro de BT trouvé");
SqlCeCommand command1 = sqlceconn.CreateCommand();
command1.CommandText = "Select NoEtape, Etape from Travaux where TypeTravail=@typ ";
string s2 = textBox1.Text;
SqlCeParameter Typ = new SqlCeParameter("@Typ", SqlDbType.NVarChar);
Typ.Value = s2;
command1.Parameters.Add(Typ);
SqlCeDataAdapter adapt = new SqlCeDataAdapter(command1);
DataSet dat = new DataSet();
try
{
adapt.Fill(dat, "SQL Temp Table");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
foreach (DataRow ligne in adapt.)
{
System.Console.WriteLine(adapt[0]);
}
}
else MessageBox.Show("Veuillez saisir un autre NBT");
}
adapter.Dispose();
sqlceconn.Dispose();
command.Dispose();
}
The errors are those
Error 1 foreach statement cannot operate on variables of type 'System.Data.SqlServerCe.SqlCeDataAdapter' because 'System.Data.SqlServerCe.SqlCeDataAdapter' does not contain a public definition for 'GetEnumerator' C:\Users\Admin\Documents\Visual Studio 2008\Projects\GMAOMobile\ModeDifféré\Travail.cs
Error 2 Cannot apply indexing with [] to an expression of type 'System.Data.SqlServerCe.SqlCeDataAdapter' C:\Users\Admin\Documents\Visual Studio 2008\Projects\GMAOMobile\ModeDifféré\Travail.cs
Error 3 foreach statement cannot operate on variables of type 'System.Data.SqlServerCe.SqlCeDataAdapter' because 'System.Data.SqlServerCe.SqlCeDataAdapter' does not contain a public definition for 'GetEnumerator' C:\Users\Admin\Documents\Visual Studio 2008\Projects\GMAOMobile\ModeDifféré\Travail.cs
Error 4 Cannot apply indexing with [] to an expression of type 'System.Data.SqlServerCe.SqlCeDataAdapter' C:\Users\Admin\Documents\Visual Studio 2008\Projects\GMAOMobile\ModeDifféré\Travail.cs
Thanks a lot for u suggestions:
|
|
|
|
|
Hi Experts,
I am getting the fullname of a type in a string say "strType" and i am getting a value also in a string say "strValue". Now i want to convert this "strValue" of type "strType". For example say
strType = "System.Datetime"
strValue = "04/21/2010"
I want to do something like this
strType.Parse(strValue)
which will return an object of type "System.Datetime".
Please help!
Thanks in Advance!
Regards,
Samar
|
|
|
|
|
Hi Samar,
I hope it can not be done like that instead,
try to identify number of types and make use of case statement to process each type.
Regards,
Surender
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
surender.m wrote: I hope it can not be done like
Absolute rubbish. Of course it can.
|
|
|
|
|
If it can be done like as he mentioned then there would not be a post here.
strType.Parse(strValue)
absolutely this is impossible... As it should have to refer dotnet framework class library.
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|