Как создать HTML таблицу на языке Си#
how to design html table in c# ??? how to pass sql server table values into html format in wpf apllication
Что я уже пробовал:
private void PDFSave() { string CmdString = string.Empty; using (SqlCeConnection conn = new SqlCeConnection(DBConnection.GetConnString())) { //CmdString = "select log.Username,log.EmailID,log.SchoolName,lt.LoginDate,lt.LogoutDate,lt.Medium from Login as log,LoginTime as Lt where log.EmailID = lt.EmailID "; SqlCeCommand cmd = new SqlCeCommand("select log.Username,log.EmailID,log.SchoolName,lt.LoginDate,lt.LogoutDate,lt.Medium from Login as log,LoginTime as Lt where log.EmailID = lt.EmailID ",conn); conn.Open(); SqlCeDataAdapter read = cmd.ExecuteReader(); cmd.ExecuteNonQuery(); DataTable dt = new DataTable("Login"); read.Fill(dt); string result = "<table class='table table-striped top-buffer'" + "style='width:300px'>" + "<tr><th>UserName(KG)</th><th>SchoolName</th><th>Date();</th></tr>"; if (read.HasRows) { while (read.Read()) { Id = read["Id"].ToString(); System.Diagnostics.Debug.WriteLine(Id); Weight = read["Weight"].ToString(); System.Diagnostics.Debug.WriteLine(Weight); Rep = read["Rep"].ToString(); System.Diagnostics.Debug.WriteLine(Rep); result += "<tr><td>" + Weight + "</td>" + "</tr><tr><td>" + Rep + "</td></tr>"; } } else { Console.WriteLine("nothing"); } read.Close();
James Walsh Jr
Какие ошибки вы получаете? Если вы не получаете ошибок, то как выход отличается от того, что вы ожидаете?