Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ResultLabel.ResultLabelAttribute(“保存成功!!!”,ProjectUserControls.Enums.ResultLabel_Color.Yellow); ResultPanel.Controls.Add(ResultLabel); GV_Employee.DataSource=null; GV_Employee.Visible=false; } 捕获(例外情况除外) { ResultLabel.ResultLabelAttribute(例如,ToString(),ProjectUserControls.Enums.ResultLabel_Color.Red); ResultPanel.Controls.Add(ResultLabel); } }_C#_Asp.net_Excel_Datetime - Fatal编程技术网

C# ResultLabel.ResultLabelAttribute(“保存成功!!!”,ProjectUserControls.Enums.ResultLabel_Color.Yellow); ResultPanel.Controls.Add(ResultLabel); GV_Employee.DataSource=null; GV_Employee.Visible=false; } 捕获(例外情况除外) { ResultLabel.ResultLabelAttribute(例如,ToString(),ProjectUserControls.Enums.ResultLabel_Color.Red); ResultPanel.Controls.Add(ResultLabel); } }

C# ResultLabel.ResultLabelAttribute(“保存成功!!!”,ProjectUserControls.Enums.ResultLabel_Color.Yellow); ResultPanel.Controls.Add(ResultLabel); GV_Employee.DataSource=null; GV_Employee.Visible=false; } 捕获(例外情况除外) { ResultLabel.ResultLabelAttribute(例如,ToString(),ProjectUserControls.Enums.ResultLabel_Color.Red); ResultPanel.Controls.Add(ResultLabel); } },c#,asp.net,excel,datetime,C#,Asp.net,Excel,Datetime,我假设行[6]是一个日期时间当您从excel获取时,您只需要 row[6].ToString("MM/dd/yyyy", CultureInfo.InvariantCulture); 将日期时间转换为字符串,并将其拆分通常是个坏主意mm说明符表示分钟,mm表示月。我假设行[6]是日期时间当您从excel中获取时,您只需要 row[6].ToString("MM/dd/yyyy", CultureInfo.InvariantCulture); 将日期时间转换为字符串,并将其拆分通常是个坏主意m

我假设
行[6]
是一个
日期时间
当您从excel获取时,您只需要

row[6].ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);

日期时间
转换为
字符串
,并将其拆分通常是个坏主意
mm
说明符表示分钟,
mm
表示月。

我假设
行[6]
日期时间
当您从excel中获取时,您只需要

row[6].ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);

日期时间
转换为
字符串
,并将其拆分通常是个坏主意
mm
说明符表示分钟,
mm
表示月。

我假设
行[6]
日期时间
当您从excel中获取时,您只需要

row[6].ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);

日期时间
转换为
字符串
,并将其拆分通常是个坏主意
mm
说明符表示分钟,
mm
表示月。

我假设
行[6]
日期时间
当您从excel中获取时,您只需要

row[6].ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
日期时间
转换为
字符串
,并将其拆分通常是个坏主意
mm
说明符是几分钟,
mm
是几个月。

试试这个

 String MyString = "12-30-2014"; // get value from text field
        DateTime MyDateTime = new DateTime();
        MyDateTime = DateTime.ParseExact(MyString, "MM-dd-yyyy",null);
        String MyString_new = MyDateTime.ToString("dd-MM-yyyy"); 
试试这个

 String MyString = "12-30-2014"; // get value from text field
        DateTime MyDateTime = new DateTime();
        MyDateTime = DateTime.ParseExact(MyString, "MM-dd-yyyy",null);
        String MyString_new = MyDateTime.ToString("dd-MM-yyyy"); 
试试这个

 String MyString = "12-30-2014"; // get value from text field
        DateTime MyDateTime = new DateTime();
        MyDateTime = DateTime.ParseExact(MyString, "MM-dd-yyyy",null);
        String MyString_new = MyDateTime.ToString("dd-MM-yyyy"); 
试试这个

 String MyString = "12-30-2014"; // get value from text field
        DateTime MyDateTime = new DateTime();
        MyDateTime = DateTime.ParseExact(MyString, "MM-dd-yyyy",null);
        String MyString_new = MyDateTime.ToString("dd-MM-yyyy"); 
试试这个代码

DateTime dt = DateTime.Parse(row[6].toString());
string date = dt.ToString("dd/MM/yyyy");
试试这个代码

DateTime dt = DateTime.Parse(row[6].toString());
string date = dt.ToString("dd/MM/yyyy");
试试这个代码

DateTime dt = DateTime.Parse(row[6].toString());
string date = dt.ToString("dd/MM/yyyy");
试试这个代码

DateTime dt = DateTime.Parse(row[6].toString());
string date = dt.ToString("dd/MM/yyyy");


在调试时,您看到了什么值?excel中的日期列不以任何格式存储其值,这只是它们的显示方式。日期是数字,就像excel中的许多其他东西一样。
“一些隐藏的错误”
?使用
try catch
找到它,并尝试从
exception
中获取所获得的
InnerException
。Aamir,如果我不得不猜测,我会说日期列中有一个或多个非日期值。只需在
obj.ExpiryDate=
行周围放置一个额外的try-catch块,您就可以看到发生了什么,并且在调试时看到了什么值?excel中的日期列不以任何格式存储其值,这只是它们的显示方式。日期是数字,就像excel中的许多其他东西一样。
“一些隐藏的错误”
?使用
try catch
找到它,并尝试从
exception
中获取所获得的
InnerException
。Aamir,如果我不得不猜测,我会说日期列中有一个或多个非日期值。只需在
obj.ExpiryDate=
行周围放置一个额外的try-catch块,您就可以看到发生了什么,并且在调试时看到了什么值?excel中的日期列不以任何格式存储其值,这只是它们的显示方式。日期是数字,就像excel中的许多其他东西一样。
“一些隐藏的错误”
?使用
try catch
找到它,并尝试从
exception
中获取所获得的
InnerException
。Aamir,如果我不得不猜测,我会说日期列中有一个或多个非日期值。只需在
obj.ExpiryDate=
行周围放置一个额外的try-catch块,您就可以看到发生了什么,并且在调试时看到了什么值?excel中的日期列不以任何格式存储其值,这只是它们的显示方式。日期是数字,就像excel中的许多其他东西一样。
“一些隐藏的错误”
?使用
try catch
找到它,并尝试从
exception
中获取所获得的
InnerException
。Aamir,如果我不得不猜测,我会说日期列中有一个或多个非日期值。只需在
obj.ExpiryDate=
行周围放置一个额外的try-catch块,您就会看到发生了什么。我尝试了您的代码,但它抛出了一个错误。字符串不重载2arguments@AamirShah
行[6]
的具体类型是什么?它是
对象
字符串
,还是
日期时间
?第[6]行的GetType()返回的是什么?datetime,它是datatime,obji尝试了您的代码,但它抛出了一个错误。字符串2没有重载arguments@AamirShah
行[6]
的具体类型是什么?它是
对象
字符串
,还是
日期时间
?第[6]行的GetType()返回的是什么?datetime,它是datatime,obji尝试了您的代码,但它抛出了一个错误。字符串2没有重载arguments@AamirShah
行[6]
的具体类型是什么?它是
对象
字符串
,还是
日期时间
?第[6]行的GetType()返回的是什么?datetime,它是datatime,obji尝试了您的代码,但它抛出了一个错误。字符串2没有重载arguments@AamirShah
行[6]
的具体类型是什么?它是
对象
字符串
,还是
日期时间
?第[6]行的GetType()返回什么?datetime,它是datatime obj