|
I don't think serv-dee likes being mocked. What a shame because I've got a whole lot of mocking that I have to get in before years end, and I'm behind schedule.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I think that with the little information available in the query, the answers given were pretty reasonable and logical. If we are being disliked for that, we cannot help it.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi All ,
I would like to to have my two variables date1 and date2 to return the following format in Asp.net.
Date1=20090625124000 and date2=20090625133900
Date1 and date2 have a diffrence on one hour in between.
How can i build date1 and date2
Thank you in advance.
|
|
|
|
|
DateTime date1 = new DateTime(2009, 6, 25, 12, 40, 0);
DateTime date2 = new DateTime(2009, 6, 25, 13, 39, 0);
string date1Str = date1.ToString("yyyyMMddHHmmss");
string date2Str = date2.ToString("yyyyMMddHHmmss");
|
|
|
|
|
string _date1 = DateTime.Now.ToString("yyyyMMddHHmmss");
DateTime _dateNew = new DateTime(DateTime.Now.Year,
DateTime.Now.Month,
DateTime.Now.Day,
DateTime.Now.Hour - 1,
DateTime.Now.Minute - 1,
DateTime.Now.Second);
string _date2 = _dateNew.ToString("yyyyMMddHHmmss");
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi,
How i can integrates my application with the active directory and autenticate the user & pass.
Thanks
|
|
|
|
|
|
Hi!
In a simple game I'm creating, I need to trigger some methods when one of the arrow keys are pressed as well as the space key.
I'm using this code in the form to receive the keyboard inputs:
protected override void OnKeyDown(KeyEventArgs e)
{
base.OnKeyDown(e);
if (e.KeyCode == Keys.Up && e.KeyCode == Keys.Space)
MessageBox.Show("UP & SPACE");
}
Nothing happens when I run the code. The OnKeyDown event don't seem to handle this condition at all.
How shall I solve this problem?
|
|
|
|
|
If you look at the documentation, (or even just try it and look at what you get) I think you will see that you get a OnKeyDown event for each key. No, not together. Seperately. One after the other.
Just how did you think e.KeyCode was going to equal two different values? Rewrite your code as
if (e.KeyCode == 1 && e.KeyCode == 2)
and you might get the point?
I am posting this to Coding horrors as a warning to all other students.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Really good answer, thanks Even if you didn't offer any solution
I have never thought that e.KeyCode never could return two or more keyboard inputs 
|
|
|
|
|
So far as I know, you can only use:
"Shift / Ctrl / Alt" + Key
But not Space and Up.
|
|
|
|
|
Yes, I know how Shift/Alt/Ctrl + key.
Back to my question, is there any solution for this at all?
|
|
|
|
|
Because you get a separate event for each key pressed if you want to do custom combinations you need to set your own flags for each key of interest in the key down events and clear them in the key up events.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
I figured out a solution based on your answer, thanks!
|
|
|
|
|
can anyone please tell me how to get the printer Job status using PJL command.I used the following command
sendString = String.Format("\x1B%-12345X@PJL \r\n @PJL JOB NAME = \"MyJob\" START = 1 \r\n PJL USTATUS JOB = ON \r\n @PJL INFO USTATUS \r\n @PJL ENTER LANGUAGE = PCL \r\n\x1B E . . . . PCL Job . . . . \x1B E\x1B%-12345X@PJL \r\n @PJL EOJ NAME = \"MyJob\" \r\n \x1B%-12345X\r\n");
Is this command appropriate?How to create JOB name or ID ?here I am giving my own name(MYJob)and job id shud b generated by printer or we have to give it while printing the document?Please help me to know the printer job status.
|
|
|
|
|
hello all,
is there any idea to do that, pls? i only found out drag and drop file to listbox control.
thanks in advance,
kyi kyi
|
|
|
|
|
Hello
I have to build an application which checks if a document is still availiable on a specific path. This application is used on our intranet. Html sites are no problem but how can I check, if a file on a Share exits? e.g. \\Server01\share$\test.doc
It should be possible to differ if the share is unavailiable or if the user hasn't enough rights to access.
Are there any opensource solutions for this problem or with which method can i solve my problem?
thanks for your help!
best reagrds
succo
|
|
|
|
|
Would System.IO.File.Exists() not do the job?
You could then catch any FileNotFound or AccessDenied exceptions?
|
|
|
|
|
Look into storing and using the UNC path[^].
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am an experienced developer in c# and working on LOB application from last 7 Years, I have some issues in understanding usage of Lambda expression in programming.
As far as i understand it is useful in case of
1) Working with LINQ (Grouping, Select,Where etc..)
2) We can pass Lambda expression to any function as argument, so it can be used in place of delegate or anonymous function or normal function.
3)We can create generic lambda function which takes any datatype variable as argument and can return any datatype
e.g.
MyFirstLambdaFunc((val1,val2) => val1+val2)
public R MyFirstLambdaFunc<R,T>(Func<T,T,R> lambdaexpression,T x,T y)
{
R Result = lambdaexpression(x, y);
return Result;
}
4)Coding can be compact
Now the question is that
1) Are there any other advantages ?
2) When we pass lambda expression as function we can pass only single line operation?
3) Can anybody have some case study or some practical example document ?
Thanks in Advance
Harish Bhattbhatt
|
|
|
|
|
Greetings, welcome to CodeProject
About your interest in Lambda, Click Here[^]
|
|
|
|
|
|
using vs2003.
Its a data entry application, having some fields and buttons.
In this, I am using combobox control, getting data from DB in DataTable obj dt, then setting the datasource property of Combobox to this dt.
there is New button, when user clicks on it, it simply clears all fields text, their DataBindings, for combox also i am using it as
cbBox.DataBinding.Clear();
cbBox.Text = "";
then there Save button which saves data to DB, on this Save click event i am checking data entered, like
if(cbBox.Text =="")
{
}
But here is problem, after clicking new button, all fields got clear, cbBox text goes blank. But if user did not enter any data in cbBox then it retains the previous text(text before clicking New button)
a) why this? how to rectify.
b)Related to DataRow?
when we load some data from DB, we fill it in Datatable obj first.
then iterate thru all rows.
SQL = "Select * from Data where ID = 23";
execute this SQL against DB.
assume ID is primary key,
now only single row returned,
How to get this DataRow without filling it in Datatable?
regards,
modified on Thursday, June 25, 2009 7:35 AM
|
|
|
|
|
Hum Dum wrote: a) why this? how to rectify.
Ans: Check whether your have written your code in
if(!page.ispostback)
{
//check whether your code lies here....
}
Hum Dum wrote: SQL = "Select name from Data where ID = 23";
execute this SQL against DB.
assume ID is primary key,
now only single row returned,
How to get this DataRow without filling it in Datatable?
string con = ConfigurationManager.AppSettings["connect"];
SqlConnection conn = new SqlConnection(con);
conn.Open();
SqlCommand cmd = new SqlCommand("select name from Data where ID=23", conn);
object obj = cmd.ExecuteScalar();
conn.Close();
string name = obj.ToString();
|
|
|
|
|
padmanabhan N wrote: if(!page.ispostback)
If i am not wrong then ispostback is for web application, mine is window......??
padmanabhan N wrote: object obj = cmd.ExecuteScalar();
It will return only 1st most column, not the entire row?
But i want whole row content.
sorry for wrong query
I want to write
SQL = "Select * from Data where ID= 23"
|
|
|
|