|
I am calling a function to which I am passing datetime as
User1.AddUser("abc","","cdf",true,DateTime.Parse("14/04/1983"),"abc@rediff.com","123","abc@gmail.com","123467","","ewq","","","Delhi","Delhi","India","110234");
The Prototype of this function is as
public int AddUser(string FirstName,string MidName,string LastName,bool Gender,DateTime DateOfBirth,string PrimaryEmail,string Password,string SecondaryEmail,string Telephone,string Mobile,string Street1,string Street2,string Street3,string City,string State,string Country,string PinCode)
But while running this function -- I am getting the exception as
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
Additional information: String was not recognized as a valid DateTime.
Plz tell me that how can i pass the Datetime type to function when I have only date.
Thanks,
Sandy
|
|
|
|
|
Look into the ToString method of the DateTime Object. I believe you can pass the format there:
Something like:
DateTime.ToString("dd/mm/yyyy")
Good Luck.
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
The CultureInfo for the application doesn't have the same idea as you do about the string format of a date.
Create the DateTime value you want instead of parsing it from a string: new DateTime(1983, 4, 14)
---
b { font-weight: normal; }
|
|
|
|
|
ManagementClass mc = new ManagementClass("Win32_TemperatureProbe");
ManagementObjectCollection moc = mc.GetInstances();
Console.WriteLine(moc.Count);
I am using above code to get temperature of CPU, but moc.Count always returns zero. why i m not getting objects in moc.
Shajeel
-- modified at 3:14 Monday 3rd April, 2006
|
|
|
|
|
Is there a temperature probe in the computer?
|
|
|
|
|
how can i check if it is installed, is it shown in device manager?
|
|
|
|
|
They don't just come with every computer, some motherboards have them and some hardware allowes then to be put in. I don't know how to check to see if there is one but look at the hardware and at the motherboard manual.
|
|
|
|
|
i can see my processor temperature from my bios. so if it shown in there, why i am not finding it through windows management.
|
|
|
|
|
Hello!
I am using a listview in C# with several columns and rows. Incoming data is added to the top row of the listview while the bottom rows are deleted on regular intervalls.
When scrolling down this list, for checking, for example the last index, the list automatically is scrolled back up to the first row on every new incoming data update. This is very annoying cause I do not want any automatic scrolling.
Does anyone know how to avoid this?
|
|
|
|
|
Hi,
//try this
listView1.Scrollable = false;
Thanks.
|
|
|
|
|
But I want it to be possible for the user to scroll throught the list, I just don't want the list to automatically be scrolled back to the top.
|
|
|
|
|
Well okay just block scrolling when you are updating the list view and then re enable it.
i hope this can solve it the you want it.
|
|
|
|
|
cbhkenshin wrote: Well okay just block scrolling when you are updating the list view and then re enable it.
How is this done? I looked for a way to do it, but couldn't find one.
|
|
|
|
|
how to automatically draw grap when the user put a number of data...?thanks
|
|
|
|
|
hackerz83 wrote: how to automatically draw grap when the user put a number of data...?
Your question is too vague.
What type of graph? line graph, bar chart, pie chart, scatter plot, etc.
What do you mean by a "number of data"? What format is the data in? How does it relate to the graph? Does it supply information for an X & Y axis?
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
hello
actually i have to import a text file into SQLServer2000 database table. i can do it from Enterprise manager of SQLServer2000 using DTS Import/Export Wizard. But i want to use SQL Server's DTS Import/Export Wizard's functionality thorugh C# application using SQLDMO.
i dont want to go to SQL Server Enterprise manager and import file from there i want to use SQLDMO and perform the same task through C# application without using SQLServer's Enterprise Manager and DTS Import/Export Wizard.
i'll be very thankful if anyone helps me. if u dont have the exact solution but can tell the website or link or any forum then plz do tell me.
if this is not the correct forum then plz guide me to the correct forum there i can get help.
you can send me mail at (adnan.developer@gmail.com).
Best Regards.
Adnan Akram
|
|
|
|
|
Try looking at the SqlBulkCopy class in the System.Data.SqlClient namespace. I've never used it, but should give you the ability to BCP a file into a Sql table. Or if you google SqlBulkCopy .Net it should return you some sites to check out.
Jake
|
|
|
|
|
can anyone help me regarding how to retrieve data from sharepoint SQL Db through any of the sharepoint service.
I am having admin right in my machine but it's not the server where sharepoint has been installed. so can i write a c# application to access sharepoint services.
anvar sadath
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
We pick a message from queue to process. The application goes down just as we have completed picking it up from queue. Message will be lost!!!! How can we prevent that.
It's Very Very Very urgent
-- modified at 1:27 Monday 3rd April, 2006
|
|
|
|
|
Which method are u using to pick the message from the queue?
Pramod
|
|
|
|
|
|
can u please send me the actual code for that method?
Pramod
|
|
|
|
|
I've created a C# application with an Access DB on the back end. The problem I'm having is it seems like the code is executing faster than the DB can accept changes. I've got an "Add New" form that the user enters data in to add a new dealer. When the user hits the Save button, I insert the new row and close the "Add New Dealer" form. I then reload my Dealer combo box on the main form from the Dealer table. However, the code seems to be reloading the the combo before the new row makes it into the table. My first thought is to Save the row, then pause the code execution for a second or two to allow the table to catch up. Then continue the code execution and reload my combo. If there's a better solution to the problem (other than getting rid of the Access DB), I'm all ears. But at the very least, I'm looking for help on how to pause the execution of the code in for a specifict interval ("Pause(2)" function below) between the "Insert row" function and the "Reload combo" function. The pseudocode is below. Thanks in advance for any help.
//On main form
private void AddNew()
{
frmAddNew.ShowDialog();//show AddNew dialog
Pause(2);//Pause code for 2 seconds
ReloadCombo();//reload Dealer combo including newly added dealer
}
//On AddNew dialog box
private void Save()
{
CollectData();//Collect user entered data from Dialog
InsertRow();//insert new row into Dealer table
this.close;//close add new form and return control to main form
}
Jake
|
|
|
|
|
Are you using separate connections for update and reading? Are you keeping the connection open during the execution of the program?
If you keep a connection open for reading and do the update using another connection, there can be quite some time before the change is visible. If you use the same connection or close the connections when they are not used, the change should show up immediately.
---
b { font-weight: normal; }
|
|
|
|