This is a mystery to me, I know the code that I took from others, in my case the data type returned by them is empty
conSTR - connection string specified as a global string
public DataTable fillDataTable(string table) { string query = "SELECT * FROM dstut.dbo." +table; SqlConnection sqlConn = new SqlConnection(conSTR); sqlConn.Open(); SqlCommand cmd = new SqlCommand(query, sqlConn); DataTable dt = new DataTable(); dt.Load(cmd.ExecuteReader()); sqlConn.Close(); return dt; }
EDIT 1
The thing is to later show this table in the datagrid view on tabcontrol, here is the question of displaying multiple data in tabcontrol C #
Here it just shows me an empty datagridview
EDIT 2
Tried all of them, when I try to display the table, datagridview is empty, has the right number of rows, but now the value
source share