As I'm not programming long time I would like to ask you if there is way to call result of this SqlCommand which is in class called klientClass
I was thinking that it could look something like this:
private static void ReadFirma()
{
string queryString =
"SELECT rocnik from FIRMA;";
using (SqlConnection connection = new SqlConnection(myConnection.DataSource.ConnectionString
))
{
SqlCommand command = new SqlCommand(
queryString, connection);
connection.Open();
int result= Convert.ToInt32(command.ExecuteScalar());
try
{
}
finally
{
reader.Close();
}
}
}
Because I need to insert this result into my report parameter here:
this.klientTableAdapter.Fill(this.prehled_zajezdu.HereReturnResult);
this.reportViewer1.RefreshReport();
I'm sorry for quiet low-quality question, hope not to receive down-votes.