|
ARINDAM1981 wrote: Datetime myDt=Convert.ToDateTime(textbox1.Text);
This works fine in my local PC.But when I uploaded this page on server it threw the following error:
"String was not recognized as a valid DateTime".
What input are you giving for the text?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
the input in my text is exactly as the following
16/04/2009
ARINDAM
|
|
|
|
|
ARINDAM1981 wrote: the input in my text is exactly as the following
16/04/2009
if the input is same for both case check the date time settings on server, weather it is dd/mm/yyyy or mm/dd/yyyy.
I will suggest you to use DateTime.Parse() and use Current Culterinfo for the convertion.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
create the date column in Datetime type....
eg create table tablename(date datetime)
|
|
|
|
|
nithydurai wrote: create the date column in Datetime type....
eg create table tablename(date datetime)
What is the relation between the Question and your answer?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
i think u are create the date column in string format....
|
|
|
|
|
Hi, try this
textbox1.text = string.format("{0:G}",datetime.now);
or visit this
http://codeincsharp.blogspot.com/2008/05/different-date-format-in-c.html
Hope this one can help.
Thanks
Hi, Please select Good Question if my answer are fit to your Question.
<div class="ForumMod">modified on Tuesday, April 28, 2009 3:07 AM</div>
|
|
|
|
|
Your post is breaking the formatting. Please post the link properly.
Thank you.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Hi,
Try using this code, this is a bit lengthy work but is useful in these type of cases.
string[] arrdate = textbox1.Text.Split('/');<br />
<br />
<br />
int year = Convert.ToInt32(arrdate[2].ToString());<br />
int month = Convert.ToInt32(arrdate[1].ToString());<br />
int day = Convert.ToInt32(arrdate[0].ToString());<br />
<br />
<br />
DateTime myDt = new DateTime(year, month, day);<br />
<br />
DateTime myDt = new DateTime(Convert.ToInt32(arrdate[2].ToString()), Convert.ToInt32(arrdate[1].ToString()), Convert.ToInt32(arrdate[0].ToString()));<br />
<br />
Regards,
Kaushal Arora
Please mark as Answer if it solved your problem.
|
|
|
|
|
I have a stored procedure that retruns XML
CREATE Stored Procedure
@Param1 INT, @Param2 INT,
AS
BEGIN
SELECT * FROM TABLENAME FOR XML PATH('XMLPATH');
END
GO
I am trying to assign this result to a variable.
i.e
DECLARE @XMLVARIABLE NVARCHAR(MAX)
SET @XMLVARIABLE = EXEC @Param1_Value, @Param2_Value;
But unable to achieve this, Can anyone help out here?
|
|
|
|
|
does it makes any sense for Cross Posting ?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
I have a stored procedure that retruns XML
CREATE Stored Procedure <proc_name>
@Param1 INT, @Param2 INT,
AS
BEGIN
SELECT * FROM TABLENAME FOR XML PATH('XMLPATH');
END
GO
I am trying to assign this result to a variable.
i.e
DECLARE @XMLVARIABLE NVARCHAR(MAX)
SET @XMLVARIABLE = EXEC <proc_name> @Param1_Value, @Param2_Value;
But unable to achieve this, Can anyone help out here?
|
|
|
|
|
Change your code as below
CREATE Procedure Proc1
(
@Param1 INT,
@Param2 INT
@Param3 NVARCHAR(1000) OUT
)
AS
BEGIN
SELECT @Param3 = (SELECT * FROM TABLENAME FOR XML PATH('XMLPATH'))
SELECT @Param3
END
DECLARE @XMLVARIABLE NVARCHAR(1000)
EXEC Proc1
@Param1 = 101,
@Param2 = 102,
@Param3 = @XMLVARIABLE OUTPUT
|
|
|
|
|
Hello Ramesh,
The solution you have given is correct, but I cannot touch the stored procedure, its already been used in lots of places. So I just have to assign the XML value returned from that stored proc.
|
|
|
|
|
im using asp.net 1.1 and in one of my aspx page i m using ajax.
now during ajax call i m showing a div which contain a rotating picture.
my problem is when i click on button window frazzed. picture is displayed for short time but not rotating.
cud anyone till me how to show waiting picture during ajax call in asp.net 1.1
One person's data is another person's program.
--J.Walia
|
|
|
|
|
Hi, can you post your code.
Hope this one can help.
Thanks
Hi, Please select Good Question if my answer are fit to your Question.
|
|
|
|
|
Hi friend,
Use callback function to show something to the user till you get a response from server. You can get server status from AJAX using that control your callback function. Refer this.[^]
Hope I have helped you to some extend.
|
|
|
|
|
because i m new in ajax so i dont know about callback function
cud u please paste the code
One person's data is another person's program.
--J.Walia
|
|
|
|
|
Do you think I understood your question ? If 'Yes' follow this[^]
|
|
|
|
|
yes i solved my problem
now i open the div onreadystatechange
Thanks for ur help
One person's data is another person's program.
--J.Walia
|
|
|
|
|
You can try the Modal Update Progress in codeproject:
http://www.codeproject.com/KB/ajax/ModalUpdateProgress.aspx
Either you love IT or leave IT...
|
|
|
|
|
Hi I'm using modal popup extender control & update panel in my application. some pages in this application have more than one update panels. now i want to disabled all the buttons in a particular page during a add/delete/update operation with displaying progress bar so that no one click on any button on the page during operation. how can i achieve this?
|
|
|
|
|
Hi, you can use asp:panel with update image like ajax.gif set your panel.visible=false
in your button add event
btnadd_click
(
panel.visible = true
Insert.....
delete....
update....
panel.visible=false
)
Hope this one can help.
Thanks
Hi, Please select Good Question if my answer are fit to your Question.
|
|
|
|
|
sayrecollado wrote: Hi, Please select Good Question if my answer are fit to your Question.
Dmm.. There is no Good Question Option only Good Answer is there
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Hi There,
I Want To Know How To Write Query With Case In Linq To Sql.
Thanks,
|
|
|
|