|
just copy the file on desired location, it will automatically replace the existing file.if i'm getting u correct
Dotnet
|
|
|
|
|
if i have two time variables:
a = 08:32 ( 08 is hours; 32 is minutes)
b = 13:54
how to compare this time format?
( the time output should be b longer than a )
Best regards,
Chee ken
|
|
|
|
|
If you use TimeSpan structures, you can compare them and do calculations on them. Example:
TimeSpan a = new TimeSpan(8, 32, 0);<br />
TimeSpan b = new TimeSpan(13, 54, 0);<br />
<br />
if (a > b) Console.WriteLine("Time a is longer.");<br />
if (b > a) Console.WriteLine("Time b is longer.");<br />
if (a == b) Console.WriteLine("They are equal.");<br />
Console.WriteLine("Comparison: " + ToString(TimeSpan.Compare(a, b)));<br />
Console.WriteLine("Differece in minutes: " + ToString((b - a).TotalMinutes));
---
b { font-weight: normal; }
|
|
|
|
|
You can also compare to DateTime values and the result is a TimeSpan
DateTime date1 = DateTime.Parse("2006-06-01 08:32");
DateTime date2 = DateTime.Parse("2006-06-01 13:54");
TimeSpan span1 = date2 - date1;
-- modified at 9:20 Saturday 21st October, 2006
Kind Regards,
John Petersen
|
|
|
|
|
I solve this problem already with your help ,thanks Guffa and John Petersen..
Best regards,
Chee ken
|
|
|
|
|
i write a string and i want convert it to aski code how can i do this.
for example:
string str = "hello";
i want convert it hello for asski code.
thanks a tone for ur help
|
|
|
|
|
All strings in .NET are Unicode, so to truly get the ASCII code you would have to encode it to ASCII first:
string str = "hello";<br />
byte[] ascii = Encoding.ASCII.GetBytes(str);
Now you have an array of bytes containing the ASCII character codes. Note that any characters outside the ASCII characer set is converted to a question mark, so if you for example converted "bidé", you would get "bid?".
If you want the Unicode character codes, you can just cast a character to an int:
int code = (int)(str[0]);
---
b { font-weight: normal; }
|
|
|
|
|
byte[] ascii = Encoding.ASCII.GetBytes(str);
what is Encoding?
we dont have Encoding in c# asp.net
|
|
|
|
|
ptvce wrote: we dont have Encoding in c# asp.net
Yes, you do. It's in the System.Text namespace.
---
b { font-weight: normal; }
|
|
|
|
|
|
hello,
this is not ASP.NET specific question. However, its really simple.
<br />
string hello = "Hello World";<br />
byte [] bytes = System.Text.ASCIIEncoding.ASCII.GetBytes(hello);
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
thats right thanks very very muchhhhhhhhhhhhhh
|
|
|
|
|
i can find a word from notpade file but dont know how to replace an other word insted of that. can any body help me?
|
|
|
|
|
You might like to change/replace the required text while the text is loaded in some variable. After replacing, you can write back to your text file.
- ashish
|
|
|
|
|
hey i am stuck with a problem ,i am asked to make a vertical menu in asp.net and c# where the data will be populated from sql server 2000 database and the menu should have infinite sub menu.
|
|
|
|
|
When does your teacher want the assignment turned in?
"When I get a little money, I buy books and if any is left, I buy food and clothes." --Erasmus
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
|
urgently need code to make a vertical menu with infinite submenu in asp.net and c# where the data will be populated from sql server 2000.Please help
|
|
|
|
|
Hi all,
I want to build online survey using asp.net and oracle database.Take this senario 3 people request the page and find this question:
what is your gender?
(radio button)male.
(radio button)Female.
2 answer male and 1 female,Iwant to know the number of people who answer male or female inorder to use this data latter on.Does i need to define a column in a table of a database and if so how to store these numbers in it.I need the colmn to be as a counter.
please help me.
|
|
|
|
|
n=n+1
"When I get a little money, I buy books and if any is left, I buy food and clothes." --Erasmus
|
|
|
|
|
- create a lookup table with 3 fields (ID, SexItemName, Value)
- create a stored procedure that increments the value column based on ID.
- databind the radiobuttonlist.
- Get the value chosen
- Call a stored procedure with the value chosen.
- Done
|
|
|
|
|
My Sql statement looks like this:
SELECT * FROM TBL_MyTable WHERE ID in (1,5,9,10,5248)
I want to use parameterized SQL command, how can I add the parameter value to it? This is what I have so far:
cmd.CommandText = "SELECT * FROM TBL_MyTable WHERE ID in @ID"
cmd.Parameters.Add("@ID", SqlDbType.Int.Int).Vlaue = "(1,5,9,10,5248)";
but its not working, any suggestions? Thanks.
|
|
|
|
|
The problem is that "(1,5,9,10,5248)" is not of type SqlDbType.Int.
You have a few options:
1. Build the CommandText string dynamically in the program.
2. Build the SQL statement in a Stored Proc, then run it via sp_executesql (NOT SAFE).
|
|
|
|
|