|
Hi, I have created a very basic ASP.NET page that has only 1 reportviewer control on it called ReportViewer1. I have installed the following code after having created an rdlc and linked it to the report at design time: string SQLConnectionString = "Provider=SQLNCLI10;Server=<MyServerName>;Database=<MyDatabaseName>;Uid=asadmin; Pwd=<password>;"; ReportViewer1.Visible = true; string SQLCommandText = "SELECT event_end_datetime, extract_ct FROM Event_log"; OleDbConnection SQLConnection = new OleDbConnection(SQLConnectionString); //OleDbCommand SQLCommand = new OleDbCommand(SQLCommandText, SQLConnection); OleDbDataAdapter SQLAdapter = new OleDbDataAdapter(SQLCommandText, SQLConnection); SQLConnection.Open(); DataSet thisDataSet = new DataSet(); SQLAdapter.Fill(thisDataSet); ReportDataSource datasource = new ReportDataSource("DataSet_EventsLogging", thisDataSet.Tables[0]); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(datasource); int count = thisDataSet.Tables[0].Rows.Count; ReportViewer1.LocalReport.Refresh(); The problem is the page always crashes with the following error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) Now, I can drop a datagrid on the page and provide the same credentials and servername settings and populate the gridview without any issues at all; so I know that this error is meaningless for the real issue but I have no clue what the real issue is so I can resolve it. I welcome and appreciate any input to assist in resolution. thanks
|