将SQL语句转换为符合VB.NET格式字符串
来源:互联网 发布:最便宜的单片机型号 编辑:程序博客网 时间:2024/06/01 08:29
将SQL语句转换为符合VB.NET格式字符串
实习中时常需要将写好的SQL语句嵌入到VB.NET的函数中,例如将下列SQL:
-- Get Mother Lot Common Info select c.customerlotnumber -- customer lot# ,c.containername --Amkor lot#, ,amk.description ,inh.txndate indate--s_time ,outh.txndate outdate -- e-time ,rs.resourcename resourcename ,emp.fullname -- ,outh.qty from container c,historymainline hml,workflowstep wfs ,operation opt,movehistory outh,moveinhistory inh ,RESOURCEDEF rs ,amkorwwoper amk ,employee emp where c.splitfromid =(select containerid from container where containername='ML6410058461') and hml.reversalstatus=1 and c.containerid=hml.containerid and hml.operationid=opt.operationid and hml.workflowstepid=wfs.workflowstepid and hml.operationid=opt.operationid and hml.historymainlineid=inh.historymainlineid(+) and hml.historymainlineid=outh.historymainlineid(+) and HMl.RESOURCEID=RS.RESOURCEID(+) and (outh.historymainlineid is not null or inh.historymainlineid is not null) and opt.amkorwwoperid=amk.amkorwwoperid and hml.employeeid=emp.employeeid order by c.containername,to_number(wfs.sequence),inh.txndate,outh.txndate 转换如下形式为: String sql in VB.NET sql = "select c.customerlotnumber -- customer lot# " & vbCrLf _ & ",c.containername --Amkor lot#, " & vbCrLf _ & ",amk.description " & vbCrLf _ & ",inh.txndate indate--s_time " & vbCrLf _ & ",outh.txndate outdate -- e-time " & vbCrLf _ & ",rs.resourcename resourcename " & vbCrLf _ & ",emp.fullname " & vbCrLf _ & "-- ,outh.qty " & vbCrLf _ & "from container c,historymainline hml,workflowstep wfs " & vbCrLf _ & ",operation opt,movehistory outh,moveinhistory inh " & vbCrLf _ & ",RESOURCEDEF rs " & vbCrLf _ & ",amkorwwoper amk " & vbCrLf _ & ",employee emp " & vbCrLf _ & "where c.splitfromid =(select containerid from container where " & vbCrLf _ & "containername='ML6410058461') " & vbCrLf _ & "and hml.reversalstatus=1 " '..
同事Tracy告诉我一个快速方法,仅仅利用UltraEdit的查找替换功能(<>号不填,仅为引用号),
查找:< ^p >
替换:< " & vbCrLf _ ^p & " >
替换的第一个"号前不可省去空格,然后填上头尾即可,^p代表回车符,也就是将回车符展开,是不是很有趣的技巧?
- 将SQL语句转换为符合VB.NET格式字符串
- c# 将字符串(符合xml格式)转换为XPathDocument
- C# 将字符串(符合xml格式)转换为XmlDocument
- SQL 将日期格式转换为常用字符串格式
- 用VB.NET将字节数组转换为字符串
- 用VB.NET将字节数组转换为字符串
- 用VB.NET将字节数组转换为字符串
- SQL语句中将字符串转换为时间格式
- 将字符串转换为内存表形式的SQL语句
- SQL语句将Null值转换为字符串空
- [VB.NET]如何将vb.NET转换为Asp.NET
- sql语句中如何将datetime格式的日期转换为yy-mm-dd格式
- 将数组转换为json格式字符串
- 将字符串转换为驼峰格式
- [VB.NET]在VB2005中如何将字符串转换为类型
- SQL 将日期格式转换为Int
- Python将JSON格式数据转换为SQL语句以便导入MySQL数据库
- Python将JSON格式数据转换为SQL语句以便导入MySQL数据库
- 怎么学习asp ?
- Linux Device Drivers 3rd Edition Debugging Techniques
- 什么是SilverLight
- Java字符集编码问题研究
- 15种简洁有效的网站推广方法
- 将SQL语句转换为符合VB.NET格式字符串
- 教你如何在VB.NET中应用SQLDMO对象
- Linux Device Drivers 3rd Edition Concurrency and Race Conditions
- C#编译器
- 增加网站流量经验谈
- jsp2.0标签--------无参数输出
- 说到正版软件方面,留意下,其实还是蛮多的
- 一个大学教授让人发冷汗的讲演
- 正式开博