I have a question. I've tried to solve it all day long and I am really stuck. I'm using VS2010 and SQL Server 2012 (quite a bad combination) and I'm trying to execute a fairly simple piece of C# and ASP.net code which goes like this:
string conn = ConfigurationManager.ConnectionStrings["BazaConnectionString"].ConnectionString;
SqlConnection connect = new SqlConnection(conn);
SqlDataAdapter sqlAdapter = new SqlDataAdapter();
SqlCommand cmd = new SqlCommand("SELECT * FROM Seminar", connect);
sqlAdapter.SelectCommand = cmd;
DataTable tablica = new DataTable();
sqlAdapter.Fill(tablica);
GridView1.DataSource = tablica;
GridView1.DataBind();
The problem is my gridview is always empty. I have data in the table and SELECT * should select all of it but I get an empty table returned. I've been trying Dataset and DataTable but nothing seems to work. Any help is appreciated. Thanks in advance.
SELECTstatement really returns values, and (3) you're not getting any exception in the process that you're just swallowing and ignoring??