I am currently working on my local machine in Visual Studio 2012. In my adminTools.aspx.cs page I am trying to call my database. This is the method that is causing me issues. protected void populateJobInformation(object sender, EventArgs e) { SqlConnection dbConnection = new SqlConnection("server=my02.Winhost.com;database=mysql_database_database;user=user;password=password;"); dbConnection.Open(); //This line is where the error occurs dbConnection.ChangeDatabase("mysql_database_database"); string query = "SELECT * FROM Properties WHERE Job= " + updateJobID.Text; SqlCommand sqlCommand = new SqlCommand(query, dbConnection); SqlDataReader records = sqlCommand.ExecuteReader(); while (records.Read()) { jobList2.Text = "" + records["jobType"]; updateJobName.Text = "" + records["jobName"]; updateJobDesc.Text = "" + records["jobDesc"]; } records.Close(); dbConnection.Close(); } WebConfig File <configuration> <connectionStrings> <add name="MySQLConnStr" connectionString="Data Source=tcp:s10.Winhost.com;Initial Catalog=database;User ID=user;Password=password;Max Pool Size=100;Integrated Security=False;"/> </connectionStrings> <system.web> <compilation debug="true" targetFramework="4.5"> <assemblies> <add assembly="AjaxControlToolkit"/> </assemblies> </compilation> <pages> <controls> <add tagPrefix="asp" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" /> </controls> </pages> <httpRuntime targetFramework="4.5" /> </system.web> <system.webServer> <handlers> <add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" /> </handlers> <validation validateIntegratedModeConfiguration="false"/> </system.webServer> <appSettings> <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" /> </appSettings> </configuration>
What are the issues you're getting? Are you getting an error message? And if so please provide us with the error message you're getting.