SQLサーバーから* .txtにエクスポートする必要があります。しかし、私は特定のFont.Exampleで私の輸出をしたいターミナルフォントを持っている私のtxtファイルが必要です。特定のフォントで* .txtにエクスポート
SqlCommand cmd = new SqlCommand("Select Code,Name,Price", con);
SqlDataReader read = cmd.ExecuteReader();
using (StreamWriter sw = new StreamWriter("C://test.txt")) {
while (read.Read())
{
//Code
string CodeString = (read["Code"].ToString());
sw.Write(CodeString);
//Name
string NameString = (read["Name"].ToString());
sw.Write(NameString);
//Price
string PriceString = (read["Price"].ToString());
sw.Write(PriceString);
}
sw.Close();
read.Close();
プレーンテキストファイルには、フォント、色、フォントサイズなどの書式設定情報は含まれていません。これを行うには、リッチフォーマットRTFやHTMLのように。たとえばGoogleを行う'c#sql server export to rtf' –