ExcelÖÐÊý¾Ýµ¼Èëµ½SQL ServerÊý¾Ý¿â
using System.Data.SqlClient;
using System.Data.OleDb;
private void tsmiImportTeacherInfo_Click(object sender, EventArgs e)
{
DataSet ds;
if (ofdImport.ShowDialog()==DialogResult.OK)
{
ds = ImportExcel(this.ofdImport.FileName); //»ñµÃExcel
}
else
{
return;
}
int odr = 0;
SqlConnection cn = db.sqlconnection();
try
{
cn.Open();
string str = "insert into Teacher (TeacherId,Pwd,eachCourse,TeacherName) values(@TeacherId,@Pwd,@TeachCourse,@TeacherName)";
SqlCommand cmd = db.sqlcommand(str,cn);
int dsLength = ds.Tables[0].Rows.Count; //»ñµÃExcelÖÐÊý¾Ý³¤¶È
&
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
Ç°²»¾Ã¿´µ½Í¬ÊÂÔÚÓÃSql Prompt3.9£¬¾õµÃÂù·½±ãµÄ¡£¸øÎÒÃÇд³ÌÐòÄÜʡϲ»ÉÙÁ¦Æø¡£·½±ã£¬sql´úÂë¿´ÆðÀ´ÓÖ¼ò½é¡£ÖµµÃÍƼö¡£http://www.red-gate.com/ÕâÊÇËüµÄ¹ÙÍø£¬ÊÇÒ»¿îÊշѵÄÈí¼þ¡£Õýʽ°æ±¾ÏÂÔØÏÂÀ´Ö»ÄÜʹÓÃ14Ìì¡£·Ï»°²»ËµÁË£¬ÏÈ¿´ÏÂЧ¹ûͼ£º
»¹²»´í°¡¡£
½ÓÏÂÀ´½éÉÜÏÂÆƽâµÄ·½·¨£¬Ïȵ½¹ÙÍø°Ñ×îаæ(ÏÖÔÚÒѾÊÇ3.9ÁË)ÏÂÏÂÀ ......
SQL Server×Ö·û´®´¦Àíº¯Êý´óÈ«
selectÓï¾äÖÐÖ»ÄÜʹÓÃsqlº¯Êý¶Ô×ֶνøÐвÙ×÷£¨Á´½Ósql server£©£¬
select ×Ö¶Î1 from ±í1 where ×Ö¶Î1.IndexOf("ÔÆ")=1;
ÕâÌõÓï¾ä²»¶ÔµÄÔÒòÊÇindexof£¨£©º¯Êý²»ÊÇsqlº¯Êý£¬¸Ä³Ésql¶ÔÓ¦µÄº¯Êý¾Í¿ÉÒÔÁË¡£
left£¨£©ÊÇsqlº¯Êý¡£
select ×Ö¶Î1 from ±í1 where charindex£¨'Ô ......
---SQLʵÏÖÍêÈ«ÅÅÁÐ×éºÏ
create function F_strSpit(@s varchar(200)) returns table
as
return(
select value=substring(@s,i,num)+substring(@s,num-1+j,1)
from (select num=number from spt_values where type='p' and number<len(@s) and number>0)TA,
(select i=number+1 from spt_values where type='p ......
create procedure DeleteWareHouse_StoreArea_SummaryByPUR
(@po_no nvarchar(100))
as
begin
declare @cacheTable table(wh_id int);--ÉùÃ÷Ò»¸ötableÀàÐ͵ıäÁ¿
insert @cacheTable select wh_id from aps_inventory_store_area where description=@po_no--Ïò±äÁ¿@cacheTableÖÐÌí¼Ó½á¹û¼¯
--select * from @cac ......