If the table adapter in dataset use connection string stored in Web.config, the report works OK when running the web page but show no data while previewing in Design mode.
I tried the solution proposed in forums but didn't work.
I debug Design Preview with a MessageBox like this...
and I get "Object not set to an instance of an object"
What am I missing?
Thanks a lot!
I tried the solution proposed in forums but didn't work.
| ConnectionStringSettings connSettings = ConfigurationManager.ConnectionStrings["myConnectionString"]; |
| if ((connSettings != null) && (connSettings.ConnectionString != null)) |
| { |
| this.hospitalDataSetTableAdapter1.Connection.ConnectionString = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString; |
| } |
I debug Design Preview with a MessageBox like this...
| } |
| catch (System.Exception ex) |
| { |
| // An error has occurred while filling the data set. Please check the exception for more information. |
| MessageBox.Show(ex.Message); |
| System.Diagnostics.Debug.WriteLine(ex.Message); |
| } |
and I get "Object not set to an instance of an object"
What am I missing?
Thanks a lot!