|
Class Program { static void Main(string[] args) {
|
Sana | 04.03.2022 | Hajmi | 10,08 Kb. | | #482578 |
| Bog'liq C# plusMsSqlServerExpress 19-bilet, 2008-narbekov-dinshunoslik-asos-uz (1), Тема-5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
class Program { static void Main(string[] args) {
string conn = @"Data Source=.\SQLEXPRESS;Initial Catalog=usersdb;Integrated Security=True";
conn.Open();
SqlCommand cmd = new SqlCommand(“SELECT * FROM [dbo].[SalesLog]”,conn);
SqlDataReader reader=cmd.ExecuteReader();
while (reader.Read())
{
Console.WriteLine(“{0},{1}”,reader.GetInt32(0), reader.GetString(1));
}
Reader.Close();
Conn.Close();
Console.ReadLine();
}
}
Do'stlaringiz bilan baham: |
|
|