1
Answer

My DataBase Connection Not connected?pls help me?

nanni nanni

nanni nanni

11y
901
1

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)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: 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)

Source Error:

Line 17:     { Line 18:         SqlConnection con = new SqlConnection("data source=SNR-PC;database=Student;User id=nanni1;Password=nanni1"); Line 19:         con.Open(); Line 20:         SqlDataAdapter adp = new SqlDataAdapter("select * from Customers", con); Line 21:         DataTable dt = new DataTable();
Answers (1)
0
ma ouml

ma ouml

NA 433 17.4k 8y
I do not know I have a column in the table "marche" named flag fence the last one will be filled if the checkbox "and last" and tick or not if it is ticked we will store O otherwise we will store N
I want when I display in the datagridview and select on one line the selected data will be placed before this property except the flag fence when it has the value O the checkbox will not check I do not know why
I hope that I have described
 
 
0
Bryian Tan

Bryian Tan

NA 9.4k 887.3k 8y
Did you meant to say how to display checkbox in the DataGridView control?
 
If that the case, here is an example:
https://www.aspsnippets.com/Articles/Add-CheckBox-Column-to-DataGridView-in-Windows-Forms-application-using-C-and-VBNet.aspx