我从xml文件中获取数据,有时日期为空.
我有这个代码:
try { TimeTo = Convert.ToDateTime(R[15].ToString()); }
catch { TimeTo = null ; }
Run Code Online (Sandbox Code Playgroud)
但我得到错误,因为我无法插入null到datetime var
我可以做什么 ?
thak提前
我安装了Windows-7 64位.当我尝试运行我的程序(适用于Oracle 11g)时,我收到此错误:
Attempt to load Oracle client libraries threw BadImageFormatException
this problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed
Run Code Online (Sandbox Code Playgroud)
可能是什么问题?哪里可以下载64位oracle客户端?
(我可以获得任何下载链接)
提前致谢
我有桌子(MEN),有900,000条记录.
在这张表中我有字段IP和Tdate.
当我运行查询时:
select * from MEN where IP = '1.1.1.1' and Tdate = TO_DATE('07/04/2010', 'DD/MM/YYYY')
Run Code Online (Sandbox Code Playgroud)
我得到结果需要很长时间.
我尝试制作这样的索引:
create index
my_in
on
MEN (IP,Tdate );
Run Code Online (Sandbox Code Playgroud)
但如何运行查询以获得快速结果?
我试试这个:
select My_in from MEN where IP = '1.1.1.1' and Tdate = TO_DATE('07/04/2010', 'DD/MM/YYYY')
Run Code Online (Sandbox Code Playgroud)
并得到错误: ORA-00904
我有数据集ds
DataSet ds = new DataSet();
SQL = "SELECT * FROM MyCount";
adp = new SqlCeDataAdapter(SQL, Conn);
adp.Fill(ds, "MyCount");
adp.Dispose();
Run Code Online (Sandbox Code Playgroud)
我写这样的xml: ds.WriteXml(@"\MyPath\Count.xml");
我需要在执行此操作时增加进度条.
怎么做 ?
谢谢
我需要在一个日期添加28天 - 我试过这个:
SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
Date date1 = df.parse("01/10/2012");
long week = 1000 * 60 * 24 * 7;
date1.setTime(date1.getTime() + week);
Run Code Online (Sandbox Code Playgroud)
但我在这一行得到了一个错误: Date date1 = df.parse("01/10/2012");
错误: Type mismatch: cannot convert from java.util.Date to java.sql.Date
我也试过这个:
Date Mydate = new Date(02,04,2012);
Calendar cal = Calendar.getInstance();
cal.setTime(Mydate);
cal.add(Calendar.DATE, 10); // add 10 days
Mydate = (Date) cal.getTime();
Run Code Online (Sandbox Code Playgroud)
但是在尝试查看Mydate值时出错了.
我需要转换为float并在SQL Server中将零填充为零.
我需要这种格式####.##.
例如:
2.23 -> 0002.23
123.3 -> 0123.30
12.65 -> 0012.65
34 -> 0034.00
Run Code Online (Sandbox Code Playgroud)
我试过这个:
cast(Weight as decimal(6, 2))
Run Code Online (Sandbox Code Playgroud)
还有这个:
REPLACE(STR(Weight, 6), SPACE(1), '0')
Run Code Online (Sandbox Code Playgroud)
还有这个:
REPLACE(STR(cast(Weight as decimal(6,2)), 6), SPACE(1), '0')
Run Code Online (Sandbox Code Playgroud)
但它们不起作用 - 我得到5.00或者000005我需要0005.00.
谢谢
我的字段X包含文本末尾带空格的文本.
我怎么能删除它们?
我在oracle 10g的任何SQL查询中都需要它.