Bonjour,
jai un probleme dans mon code c#,je veux tt simplement mconnecter et une base de donnees SQLSERVER2005 jai ecri le code suivant :
string strConnectionString = ConfigurationManager.ConnectionStrings["Data Source=MAXIMUS\SQLEXPRESS;Initial Catalog=AXA;Integrated Security=True"].ConnectionString;
SqlConnection myConnection = newSqlConnection(strConnectionString);
try
{
// query to execute
string strQuery = "select * from Agent";
// create the command
SqlCommand myCommand = newSqlCommand(strQuery, myConnection);
// add the parameters
//myCommand.Parameters.AddWithValue("@Name", PlayerName.Text);
//myCommand.Parameters.AddWithValue("@ManufacturerID",ManufacturerList.SelectedValue);
//myCommand.Parameters.AddWithValue("@Cost", PlayerCost.Text);
//myCommand.Parameters.AddWithValue("@Storage", PlayerStorage.Text);
// open the connection
myConnection.Open();
// execute the query
}
catch
{
// return -1 to indicate error
}
finally
{
// close the connection
myConnection.Close();
}
et lorske jcompile le code ,jai tjr ce msg d'erreur :
Séquence d'échappement non reconnue
je c tres bien que le probleme et ds "
\S" du chaine de connexion et je cherche une solution
merci d'avance