While running this code "Invalid token 'try' in class, struct, or
interface member declaration" error is comming. Please advice me......
I am new to asp.net.
try
{
string connString = "Server=server0 4;Database=Nort hwind;Integrate d
Security=SSPI";
string sql = "SELECT * FROM EmployeeDetails ";
SqlConnection conn = new SqlConnection( connString );
SqlCommand command = new SqlCommand( sql, conn );
conn.Open();
SqlDataReader reader = command.Execute Reader();
this.dgEmployee details.DataSou rce = reader;
conn.Close();
// this.dgEmployee details.DataBin d();
}
catch ( Exception ex )
{
MessageBox.Show (ex.Message);
}
finally
{
conn.Close();
}
Comment