1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
class DBData { static string connectionString = "server= 111.222.333.444;uid=id;pwd=pppp;database=UEUE"; public static string QueueHTML(string SID) { SqlConnection conn = new SqlConnection(connectionString); SqlDataAdapter da = new SqlDataAdapter(); DataSet QUEUE = new DataSet(); try { conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "QueueList"; SqlParameter paramSID = cmd.Parameters.Add("@SID", SqlDbType.Char, 3); paramSID.Direction = ParameterDirection.Input; paramSID.Value = SID; da.SelectCommand = cmd; da.Fill(QUEUE, "QUEUE"); XslCompiledTransform xslt = new XslCompiledTransform(); StringWriter stringWriter = new StringWriter(); xslt.Load("Queue.xsl"); XsltArgumentList args = new XsltArgumentList(); XmlDocument xml = new XmlDocument(); string dbXML = QUEUE.GetXml(); xml.LoadXml(dbXML); xslt.Transform(xml, args, stringWriter); string Content = stringWriter.ToString(); return Content; } catch (Exception ex) { //클라이언트에게 예외를 던진다. //throw ex; string Err = ex.ToString(); return ""; } finally { } } } |