S
sha2kk3
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=server04;Database=Northwind;Integrated
Security=SSPI";
string sql = "SELECT * FROM EmployeeDetails";
SqlConnection conn = new SqlConnection( connString );
SqlCommand command = new SqlCommand( sql, conn );
conn.Open();
SqlDataReader reader = command.ExecuteReader();
this.dgEmployeedetails.DataSource = reader;
conn.Close();
// this.dgEmployeedetails.DataBind();
}
catch ( Exception ex )
{
MessageBox.Show (ex.Message);
}
finally
{
conn.Close();
}
interface member declaration" error is comming. Please advice me......
I am new to asp.net.
try
{
string connString = "Server=server04;Database=Northwind;Integrated
Security=SSPI";
string sql = "SELECT * FROM EmployeeDetails";
SqlConnection conn = new SqlConnection( connString );
SqlCommand command = new SqlCommand( sql, conn );
conn.Open();
SqlDataReader reader = command.ExecuteReader();
this.dgEmployeedetails.DataSource = reader;
conn.Close();
// this.dgEmployeedetails.DataBind();
}
catch ( Exception ex )
{
MessageBox.Show (ex.Message);
}
finally
{
conn.Close();
}