TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kreshnike Rahmani
NA
14
16.4k
Error during the execution of an sql comand in C#
Dec 25 2012 7:20 PM
Here down there is my code, when I execute it it says that I have an syntax error near GrupetStudentet, While thos query works very good on sql server, but when O write it on my code it says that I have a problem. PLs can somebudy help me if you know th answer.
string ID;
ID = txtIDstudent.Text;
string sql = "SELECT gs.Grupi_ID, (s.Emri + ' ' + s.Mbiemri) as Studenti, n.EmriNivelit as Niveli, k.EmriKursit as Kursi";
sql +="FROM GrupetStudent gs";
sql +="inner join Studenti s on gs.Studenti_ID = s.Studenti_ID";
sql +="inner join Niveli n on gs.Nivel_ID = n.ID_nivelit";
sql +="inner join Kursi k on gs.Kursi_ID = k.ID_kurs";
sql +="WHERE s.Studenti_ID="+ID;
if (txtIDstudent.Text == "")
{
MessageBox.Show("Ju lutem shënoni ID-në e studentit");
}
else
{
SqlDataAdapter DaKerko = new SqlDataAdapter(sql, con);
DataTable dtKerko = new DataTable();
DaKerko.Fill(dtKerko);
Reply
Answers (
2
)
c# windows application
From Date and To date for that validate code needs me