|
Hi
My code displays the error in top
cmd = New SqlCommand("spStudent", con1)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add(New SqlParameter("@EnterDate", SqlDbType.DateTime, 8))
cmd.Parameters("@EnterDate").Value = "01/09/2009"
cmd.CommandTimeout = 1800
cmd.ExecuteNonQuery()
Sda = New SqlDataAdapter(cmd)
Sda.Fill(dt)
How to resolve this problem... please help
Regards,
Samson
modified on Friday, January 9, 2009 5:35 AM
|
|
|
|
|
Try:
cmd.Parameters("@EnterDate").Value = New Date(1, 9, 2009)
|
|
|
|
|
cmd.Parameters("@EnterDate").Value = New Date(1, 9, 2009)
This one is Date(year, month, Date) Format.
But my Format is MM/dd/yyyy.... Please help further
With Regards,
Samson
|
|
|
|
|
Ah I see, sorry, I misread your post. Unfortuanately I can't offer any more help, sorry.
|
|
|
|
|
samsonx wrote: cmd.Parameters("@EnterDate").Value = "01/09/2009"
Convert "01/09/2009" to dateTime variable and then assign the value to parameter.
The format of DateTime does not matter during the Saving of information.
|
|
|
|
|
That means that the database doesn't use the same date format that you use, and is parsing it to a completely different date, like perhaps '0001-09-09'. This is outside the range of dates that the datetime type in the database can handle, hence that specific error message.
Parse the string into a DateTime value before you put it in the parameter:
cmd.Parameters("@EnterDate").Value = DateTime.ParseExact("01/09/2009", "MM/dd/yyyy", CultureInfo.InvariantCulture)
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Try date format with
cmd.Parameters("@EnterDate").Value = cdate("#01/09/2009#")
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
in my application i want to draw n level treeview with dataset
please help me in this matter and if possible please give me some example because i am never use treeview before
|
|
|
|
|
aajignesh wrote: i am never use treeview before
...or Google apparently. Only about 378,000 hits on google for treeview samples in VB so it should be possible for you to use one of those.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Sarcasm is the lowest form of wit but I love it
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: Sarcasm is the lowest form of wit
I know, but sometimes its just too tempting
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Ah the rapier like thrust of a well weighted insult into the vitals of such a pillock as this, is most satisfying I must admit.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: Ah the rapier like thrust of a well weighted insult
Wouldn't say it was that good
Mycroft Holmes wrote: such a pillock as this
can't argue about that
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Just parse your datatable in dataset with parent and child fields and add nodes to treeview, can you handle this or you want more in code?
|
|
|
|
|
Ya sir Please Give Me Some code
|
|
|
|
|
Hi to All,
I have created a new process using
dim p as new process
And then I have ran a particular file. But, I ran that in a loop, where three process will be created with the same file/exe. Would there be any concurrency problem?
Thax in advance
|
|
|
|
|
Do you mean you are running the same EXE three times concurrently? Probably not, but some EXEs don't like being run at the same time as another instance of them. It depends on the EXE.
|
|
|
|
|
thax colin....I am running an powerpoint ppt,..So is there any problem.
Actually, my current situation is somethng like this:: i have a server, where my ppt(for quize) is stored. Now from each client connected to it, I am running the same ppt( in fact am planning to make it as pps format).
Now what I felt is, because every process has its own stack and all, it wont have any problem . But still I want to conform it.. Could u pls lel me know about the same...
Thanks in advance
Himangshu
|
|
|
|
|
PowerPoints should have no problem with running on multiple computers at once (in fact, my college computer science course is doing it right now). However PowerPoint may set the file as read-only beyond the first person open the file. That way any editing is done by one person.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hi all...
I want to change system volume through my application.
Suggest me how can I do this.
Thanks.
Gagan
|
|
|
|
|
What do you mean by "system Volume
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
system volume means I want to control master volume of system through my program.
|
|
|
|
|
Import "winmm.dll". You will find suitable methods to do so.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
|
|
|
|
|
Hi Experts,
I am making an vb.net application in vs2005. I run a ppt( quize ) (which is a VBA application again,) from a button click using process.
Now my problem is to link/share the vb.net variable with the variable which i am using in VBA coding(ie total score of quize). so that I can write the score for the particular user who has logged in in my application and has ran the powerpoint(VBA).
[ score is a vriable in VBA, username is the variable present in vb.net application ]
Thanks in advance
Himangshu
|
|
|
|
|
Member 4250705 wrote: Now my problem is to link/share the vb.net variable with the variable which i am using in VBA coding(ie total score of quize).
You can't share variables between two entirely different processes. Your VBA code would have to put this value in a hidden textbox on a PowerPoint slide, then your VB.NET code would have to run PowerPoint as a COM server, show the slide show, let the VBA code run, then pick out that value from the slide using PowerPoint's object model.
No, I don't have any example code. I don't normally do any Office Interop.
Oh, and noone cares how urgent it is. It's not going to get you an answer any faster. After all, you're not paying for this support, are you?? We all donate our time here to answer questions, and we do it when we can, not when you insist on it. We don't get paid to do this...
|
|
|
|