After this www.codeproject.com/Articles/31862/Dynamic-Binding-Of-RDLC-To-ReportViewer i realize that i must drag and drop the table from the Server Explorer to the DataSet
,first that was good until i have to send the project to the client, my connection string is Data Source=.\SQLEXPRESS;AttachDbFilename=G:\I.S\C#\billingSystem\Store.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True
and of course when i send it to the client the directory will change and the DataSet
will complain about it, is there a way to make a connection between the Dataset
and the Table
just like how the normal insert, delete, update work?:
SqlCommand cmd = new SqlCommand("SQLSTATEMENT", cn); cn.Open(); cmd.ExecuteNonQuery(); cn.Close();
Or
cn.Open(); SqlDataAdapter sda = new SqlDataAdapter("SQLSTATEMENT", cn); sda.Fill(dt); cn.Close();
After googling i find out there is DataAdapter
fill the DataSet
with data from the table "query" then BindingData
to the ReportViewer
so How to make them work together with SqlConnection
string so it target the directory and show the data in the reportviewer? Note: this is a win form app, invoice system project