using System.Data.SqlClient;
string connectionString = "Data Source=SERWER;Initial Catalog=NAZWA_BAZY_DANYCH;User ID=LOGIN;Password=HASLO";
string queryString = "SELECT * FROM TABELA";
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlCommand command = new SqlCommand(queryString, connection);
connection.Open();
using (SqlDataReader reader = command.ExecuteReader())
while (reader.Read())
// odczytaj dane z bazy danych
}
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
using System.Data.SqlClient;
string connectionString = "Data Source=SERWER;Initial Catalog=NAZWA_BAZY_DANYCH;User ID=LOGIN;Password=HASLO";
string queryString = "SELECT * FROM TABELA";
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlCommand command = new SqlCommand(queryString, connection);
connection.Open();
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
// odczytaj dane z bazy danych
}
}
}