Hello every one..
I have this exception while trying to execute an insert command into a simple sql database

string myChar = charNameTextBox.Text;

 string command = "insert into data (char,Entropy,Uniformity,stadev,smoothness,skewness,kurtosis) values(" + myChar + "," + entropy + "," + uniformity + "," + standardDeviation + "," + Smoothness + "," + skewness + "," + kurtosis + ")";

sqlComm = new SqlCommand(command, sqlConn);

this is the exception ..occures against char with value myChar..
char is defined as nvarchar(MAX)
The name "ب" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.

im sure i made a mistake but i can't discover where and i have not been working with database for a long time..

thanks in advance..

hello again
i think i was quick in submitting this thread

the problem was easy and solved by just adding single quotation
before and after the value myChar since it is a string

sorry for this mistake
my regards..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.