You must Sign In to post a response.
  • Category: ASP.NET

    Error in connecting when using the web config file in using C#

    in .aspx code as follows

    protected void Page_Load(object sender, EventArgs e)
    if (!IsPostBack)


    private void BindGrid()
    string strConnString = ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString;
    using (SqlConnection con = new SqlConnection(strConnString))
    using (SqlCommand cmd = new SqlCommand())
    cmd.CommandText ="select Tb_Employee";
    cmd.Connection = con;
    gvEmpdetails.DataSource = cmd.ExecuteReader();

    When i run the application shows error as follows

    Keyword not supported: 'Mymachine\sqlserver2012; integrated security'

    please help me.

    what is the mistake in my above code
  • #765761
    Hi rao,

    I guess the problem is connection string, please recheck your connection string and if you have any doubts, generate the connection string either using Visual studio or sql server and use that connection string in your web config file.

    Refer below link, for more details how to generate the connection string using visual studio.

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • Sign In to post your comments