ÔÚasp.netÖнÓÊÕsql serverÖд洢¹ý³ÌµÄ·µ»ØÖµ
´æ´¢¹ý³Ì´úÂ룺
create procedure proc_name
@para1 nchar(20), --ÊäÈë²ÎÊý
@para2 int = null output¡¡--Êä³ö²ÎÊý£¬¹©³ÌÐòʹÓÃ
as
begin
if (@para1='a')
begin
insert into employee(name) values(@para1)
select @para2=@@identity --·µ»ØÌí¼Ó¼Ç¼µÄID
return 1 --·µ»ØÊÇ·ñ³É¹¦Ìí¼ÓÊý¾Ý
end
else
return 0 --·µ»Øʧ°Ü
end
go
ÔÚ²éѯ·ÖÎöÆ÷ÖеIJâÊÔ£º
declare @id nchar(10)
exec dbo.proc_name 'a',@id output
print @id
ÔÚasp.netÖе÷Óãº
sqlcommand command;
command = new sqlcommand(proc_name,new sqlconnection(connectionstr));
command.paraments.add("@para1"),"name1"); //ÊäÈë²ÎÊý£¬Ö°Ô±ÐÕÃû
command.paraments.add(new sqlparament("@para2", //Éú³ÉÒ»Êä³ö²ÎÊý
SqlDbType.Int;¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//²ÎÊýÊý¾ÝÀàÐÍ
ParamenterDirection.OutPut,¡¡¡¡¡¡¡¡¡¡¡¡//ÊäÈëÊä³öÀàÐÍ
0,
0,
string.Emplty,
DataRowVerstion.Default,
null)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//²ÎÊýÖµ£¬ÊäÈë²ÎÊýʱÐèÌṩ
);
command.commandtype=commandtype.StoredProcedure;
command.connection.open();
command.executenonQuery();
int pkid=(int)command.Parameters["@para2"].value; //µÃµ½Êä³ö²ÎÊýµÄÖµ
command.connection.close();
×¢ÒâºìÉ«±ê×¢µÄµØ·½£¬ÕâÔÚÉèÖòÎÊýʱºÜÖØÒª¡£
Ïà¹ØÎĵµ£º
×î½ü·ÃÎÊÁ˽¨ÐÐÍøվʱ https://ibsbjstar.ccb.com.cn/V5/index.html#£¬£¨ÆäʵÔÚoblog,http://www.oblog.cnÒ²²ÉÓÃÁËÀàËƵļ¼ÇÉ£¬²»¹ý·½·¨²»Í¬°ÕÁË£©
¡¡¡¡¿ÉÒÔ·¢ÏÖ£¬µ±Ñ¡Ôñ²»Í¬µÄÎı¾¿ò£¬¿ÉÒÔ³öÏÖ²»Í¬µÄÑÕÉ«£¬ÒªÍê³ÉÕâ¸ö¹¦Äܼܺòµ¥£¬µ«ÊÇÈç¹ûÓкܶàÀàËƵŦÄÜ£¬Èç¹ûÒ»¸ö¸öÉèÖÿؼþÑùʽÏÔÈ»ºÜÀÛ£¬Ò»¸ö¼òµ¥µÄ´¦Àí·½·¨Ð´Ò»¸ö·½· ......
http://www.cnblogs.com/TerryFeng/archive/2009/02/01/1382123.html
ÕâºÜ³£Óã¬ËÑË÷ÁËһϲ©¿ÍÔ°µÄ“ÕÒÕÒ¿´”ºÍ¹È¸è£¬¿´µ½´ó²¿·Ö¶¼ÊÇתÔØÓÚÒ»Á½ÆªÎÄÕ£¨¶øÇÒÀ´Ô´»¹²»ÊDz©¿ÍÔ°£©£¬ÓеÄÊǼòµ¥µÄ˵һµãÎÞ·¨ÔËÐУ¬¸ø³õѧÕߵĵ÷ÊÔºÍѧϰ´øÀ´²»·½±ã£¬ÎÒÔÚÕâÀォjQuery Ajax µ÷ÓÃAspx.Net WebService µÄ¼¸¸ö³£Óõķ½·¨ ......
var j = jQuery.noConflict();
var prov="";
var city="";
var area="";
j(function(){
j.get("/Js/Message/address.xml",function(xml){
j("body").data("xml",xml);
  ......
µÚÒ»:
Response.Write(<script></script>);
µÚ¶þ:
ÍÐÒ»¸öLiteral¿Ø¼þ
Literal(¿Ø¼þÃû).Text="<script></script>";
......
ÎÒÃǾ³£ÒªÔÚÒ»¸ö±íÖн«Êý¾ÝǨÒƵ½ÁíÒ»¸ö±í£¬µ±È»£¬Óõķ½·¨Ê®·Ö¶àÁË¡£ÔÚ.net 2.0ÖУ¬ÌṩÁËÒ»¸ösqlbulkcopyÀ࣬Ҳ¿ÉÒÔʵÏÖÈçϵIJÙ×÷£¬ÏÂÃæ¼òµ¥½éÉÜÏ¡£±ÈÈçÒ»¸ö±íÈçÏÂ
CREATE TABLE Person3
(
PersonID int IDENTITY(1,1) PRIMARY KEY,
Name nvarchar(200),
Email nvarchar(200),
Picture image
)
INSERT INT ......