|
Hi Nick
Casting is normally between used between inherited types (implicitly) or when a cast has been specified (explicity).
Converting (or Parsing) is used between unrelated types and allows one to be converted to the other and/or vica versa.
Hope this helps
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
Hi,
I've tried google but I couldn't find anything useful. Do you know a link to a sites with different .NET compatible languages?
I'm particularly interested in Scheme, COBOL, FORTRAN
Thank you!
|
|
|
|
|
Here[^] you go.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
Does anyone have any hints as how to implement a progress bar for a status panel?
I'm not entirely certain how to do it... Any ideas?
--
Richard
|
|
|
|
|
Richard Smith wrote:
Does anyone have any hints as how to implement a progress bar for a status panel?
I think you can host controls inside a statusbar panel. But it would probably be better to do a custom statusbar...
From MSDN:
Typically a StatusBar control consists of StatusBarPanel objects, each of which displays text and/or an icon. You can also provide owner-drawn panels to provide custom panels such as a progress bar or a series of images that displays the state of your application.
...
The default StatusBar has no panels. To add panels to a StatusBar you can use the Add method of the StatusBar.StatusBarPanelCollection class that is accessible through the Panels property of the control. You can also use the StatusBar.StatusBarPanelCollection object provided through the Panels property to remove panels from the control and access a specific StatusBarPanel object to manipulate the panel.
Now just add the progress bar to the panel
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
|
You might consider what Masaaki has suggested, however I tried something extremely simple which I believe take a lot of the pain out of it.
Basically add a status bar to your form, then drag a progress bar onto the status bar placing it in the lower left hand corner of the status bar, you do not need to add a panel to the status bar. With the progress bar item selected go to the Anchor property and click on both the Bottom and Left "bars". The text value inside the Anchor property should read "Bottom, Left". Run your app, the progress bar will stay in sync with you form at all times now.
Nick Parker
The greatest lesson in life is to know that even fools are right sometimes. - Winston Churchill
|
|
|
|
|
Hehehehe, Thanks guys.
I think I'll go with the first Idea. It may be a pain in the arse, but once I've done it, I know I'll use it again.
Thanks for the cheats... I'll prolly use those if I'm in a rush
--
Richard
|
|
|
|
|
When i run this program,it says Must declare the variable '@Country'.
What should i do.
string selectSQL = "SELECT CustomerID, CompanyName FROM ustomers WHERE Country = @Country AND City = @City";
OleDbConnection nwindConn = new OleDbConnection("Provider=SQLOLEDB;Data Source=localhost;" +
"Integrated Security=SSPI;Initial Catalog=northwind;");
OleDbDataAdapter custDA = new OleDbDataAdapter();
OleDbCommand selectCMD = new OleDbCommand(selectSQL, nwindConn);
custDA.SelectCommand = selectCMD;
// Add parameters and set values.
selectCMD.Parameters.Add("@Country", OleDbType.VarChar, 15).Value = "UK";
selectCMD.Parameters.Add("@City", OleDbType.VarChar, 15).Value = "London";
DataSet custDS = new DataSet();
custDA.Fill(custDS, "Customers");
|
|
|
|
|
Try setting the two parameters before you set the custDA.SelectCommand.
Paul
Life is just a sexually transmitted desease - Matthew Wright (ex-journalist, TV presenter) 10-Oct-02
I finally have a sig! - Paul Riley (part-time deity) 10-Oct-02
|
|
|
|
|
I tried that also,but no use.
|
|
|
|
|
Okay... next guess:
SELECT CustomerID, CompanyName FROM ustomers...
Are you really trying to select from the "ustomers" table?
Paul
Life is just a sexually transmitted desease - Matthew Wright (ex-journalist, TV presenter) 10-Oct-02
I finally have a sig! - Paul Riley (part-time deity) 10-Oct-02
|
|
|
|
|
Gahhh, I just had a strange flash of inspiration. I'm pretty sure those Parameters.Add("@Variable"... lines shouldn't have the @ symbol in them.
@ in the SQL line defines where the parameters are but is not part of the parameter name.
Paul
Life is just a sexually transmitted desease - Matthew Wright (ex-journalist, TV presenter) 10-Oct-02
I finally have a sig! - Paul Riley (part-time deity) 10-Oct-02
|
|
|
|
|
Paul Riley wrote:
@ in the SQL line defines where the parameters are but is not part of the parameter name.
All the code I have seen do that (add @), I guess maybe it deals with it internally.
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
Really? Shucks!
In that case I return to my "ustomers" theory
Paul
Life is just a sexually transmitted desease - Matthew Wright (ex-journalist, TV presenter) 10-Oct-02
I finally have a sig! - Paul Riley (part-time deity) 10-Oct-02
|
|
|
|
|
|
Just an idea, but does it matter that the variables are the same name as the fields??
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
OK I think I might have the answer for you
string selectSQL = "SELECT CustomerID, CompanyName FROM Customers WHERE (Country = @Country) AND (City = @City)";
suresh_sathya wrote:
When i run this program,it says Must declare the variable '@Country'.
string country = "UK";
string city = "London";
selectCMD.Parameters.Add("@Country", OleDbType.VarChar, 15).Value = country;
selectCMD.Parameters.Add("@City", OleDbType.VarChar, 15).Value = city;
Try that too
Hope it helps!
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
im using regular expressions for something, but i have found a situation where i will need to search for the * character, which has a meaning in the regex, what should i do?
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
Use the escape character \
A note from MSDN:
Note If you are using C++, C#, or JScript, special escaped characters, such as \s, must be preceded by an additional backslash (for example, "\\s2000") to signal that the backslash in the escaped character is a literal character. Otherwise, the regular expression engine treats the backslash and the s in \s as two separate operators. You do not have to add the backslash if you are using Visual Basic .NET. If you are using C#, you can use C# literal strings, which are prefixed with @ and disable escaping. For example, @"\s2000"
My latest articles:
XOR tricks for RAID data protection
Win32 process suspend/resume tool
|
|
|
|
|
thanx
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
I know that you already found the solution, but you should get Eric Gunnerson's RegEx Workbench app from GotDotNet. It's really useful. And of course, you have the code so you can change anything you don't like...
http://www.gotdotnet.com/userarea/filedetails.aspx?FileName=regexworkbench.zip[^]
Norm Almond: I seen some GUI's in my life but WTF is this mess
Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
-Norm on the MailMagic GUI
|
|
|
|
|
And if you find something you don't like, please let me know so I can consider adding it...
|
|
|
|
|
You asked for it...
Just kidding. The only thing I didn't like was when I clicked the button in the top left, the context menu appeared way away from the mouse, in the textbox. So I just changed the parent of the context menu to the button instead. Less mouse travelling that way...
Norm Almond: I seen some GUI's in my life but WTF is this mess
Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
-Norm on the MailMagic GUI
|
|
|
|
|
Hi,
I have problem with email messages.
I have downloaded email header and I'm trying to get subject of this message.
If there are only english characters, everything is ok
"Subject: emailsubject"
But when I use other characters (I live in Czech Republic ) it looks like this:
"Subject: =?iso-8859-2?Q?Email=20message=20with=20=BE=F8=E8?="
So I want to convert this " " to .Net string (UNICODE)
Thank You
PS: I have seen some code for this on CP http://www.codeproject.com/string/ammimeutils.asp[^], but it doesn't works with other codepages (I think)
|
|
|
|