我有一些空格问题,我不知道如何解决它。它应该是这样的:
但它实际上是这样的:
public void azurirajPodatke()
{
richTextBox1.Clear();
try
{
con.Open();
string kom = "select * from Pecaros order by PecarosID asc";
cmd = new SqlCommand(kom, con);
dr = cmd.ExecuteReader();
while (dr.Read())
{
string id = dr[0].ToString();
string ime = dr[1].ToString();
string prezime = dr[2].ToString();
string adresa = dr[3].ToString();
string telefon = dr[4].ToString();
string grad = dr[5].ToString();
string linija = string.Format(
"{0,-15}|{1,-10}|{2,-15}|{3,-15}|{4,30}|{5,-15}",
id, ime, prezime, adresa, telefon, grad);
richTextBox1.Text += linija+"\n";
}
dr.Close();
}
}