I made program and install it on client computer. On that same computer I created sql server, so it is local server.
When program is started it connect to server and load some data into datagridview. Works great, insert, update, select.
But when I go to part of program that use reportviewers, there is a problem: Report is load (empty), but when I try to fill it with data I get long error message
"A network related or instance specific error occurred.......error 26 - error locating server/instance specified.
Connection string is in app.config and it is ok because same program already use same database. For creating report I use wizard and after that only bind it from report viewer task -> choose report.
Also, that same report work on my computer, so I think that code is ok and problem is in server or in dataset generated by wizard, but I am out of idea.
Error details is too long, but in this part could be something important. After this part is list of Loaded Assemblies.
>>>Error details<<<
EDIT:
Here is code, but it is generic, made by VS, not me:
private void Form6_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'DataSet4.DataTable1' table. You can move, or remove it, as needed.
this.DataTable1TableAdapter.Fill(this.DataSet4.DataTable1);
// TODO: This line of code loads data into the 'SviKlijentiDataSet.SviKlijenti' table. You can move, or remove it, as needed.
this.SviKlijentiTableAdapter.Fill(this.SviKlijentiDataSet.SviKlijenti);
this.reportViewer1.RefreshReport();
}
BIG EDIT: Problem is that my dataset does not read connection string from app.config file. How to order dataset to use connection string from app.config file?
Talk1:
Can you provide some code where you pass your data to your report ?
Talk2:
can you post details section of error shown in Picture ?
Talk3:
Post your connection string.
Talk4:
connectionStrings>
Talk5:
I would make sure the computer name in this string matches the client computer and not your computer.
Solutions1
I find the problem. Strange combination of my mistake and (I think) Visual Studio bug. Anyway:
My connection string name is Zavrsni, and all connection in code are using that string, and that was only string that I had in app.config. But, VS for datasets created ZavrsniConnectionString, and that string I didn't have in app.config file. Only when I changed my con string to something else to purposely made a mistake in program, only then that other connection string appeared in app.config file and then I realize that I have two con strings. One more strange thing, in solution properties I also had only one con string. Now everything is working.
Five days headache can now finally end. Thanks for all comments and idea.