java如何調(diào)用存儲(chǔ)過程 存儲(chǔ)過程中將用selectforxml查詢到得結(jié)果另存為xml文件?
存儲(chǔ)過程中將用selectforxml查詢到得結(jié)果另存為xml文件?例如,我有一個(gè)存儲(chǔ)過程create proc[dbo]uselect]@sno nchar(7)asselect sname,sse
存儲(chǔ)過程中將用selectforxml查詢到得結(jié)果另存為xml文件?
例如,我有一個(gè)存儲(chǔ)過程create proc[dbo]uselect]@sno nchar(7)asselect sname,ssex,sage,sdeptfrom studentwheresno=@sno當(dāng)我得到一個(gè)查詢結(jié)果時(shí),我調(diào)用存儲(chǔ)的結(jié)果字符串SnO=textbox1文本。修剪()string conStr=“數(shù)據(jù)源=PC-20110624IRHPSQLEXPRESSInitial Catalog=”conStr=conStr“students2Integrated Security=sspi”SqlConnection Con=new SqlConnection(conStr)Con.打開()string s=“iSno”Select“”sno“”SqlCommand cmd=new SqlCommand(s,Con)SqlDataReader dr=cmd.ExecuteReader命令()XmlDocument objDom=新建XmlDocument()