I downloaded a project from the web with its database. I run the project and add its database to tab server on VS 2008 Sp1 and have SQl server 2008.
But when I copy a new connection string to the program, I get the following error message:
Unrecognized escape sequence
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
namespace AzmongirSource
{
class cl
{
static public string idstudent;
static public string userteacher;
static public string nameazmon;
static public string codeazmon;
static public string azmon_typ;
static public string azmon_for_test_type;
static public string time_limit;
static public string tedade_soalat;
static public SqlConnection connection = new SqlConnection();
static public SqlCommand command = new SqlCommand();
static public SqlDataReader reader;
static public int truequestion = 0, falsequestion = 0, noquestion = 0;
static public void creatconnection()
{
connection.Close();
connection.ConnectionString = "Data Source=WINXPX86-BE;AttachDbFilename=D:\payegah\azmoongir_data.MDF;Integrated Security=True";
connection.Open();
command.Connection = connection;
}
static public DataTable StudentList()
{
creatconnection();
string query = "Select idstu as[شماره دانشجویی],namestu as [نام],familystu as [نام خانوادگی],standardcode as [کداستاندارد],reshte as [رشته] from tbl_student";
SqlDataAdapter da = new SqlDataAdapter(query, cl.connection);
DataTable dtt = new DataTable();
da.Fill(dtt);
connection.Close();
return dtt;
}
}
}