Connection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

u have DB made by SQL i need to connect on that DB throught C#
i made a DataAdaprtot from the Wizard & gave it the name of DB & slelected
all tables in it to retrive data from
but while getting data in Data set it gave me that error

Generated SELECT statement.
Deferred prepare could not be completed.
Statement(s) could not be prepared.
Incorrect syntax near the keyword 'FROM'.


and that is the select statement that the C# created

SELECT
FROM
Alex_Univ INNER
JOIN
Departements ON
Alex_Univ.F_no = Departements.F_no INNER JOIN [Dummy] ON
Departements.Dept_no = [Dummy].Dept_no INNER JOIN Courses ON
[Dummy].Course_Id = Courses.Course_Id INNER JOIN Stuff_Info ON
Departements.Dept_no = Stuff_Info.Dept_no INNER JOIN Tel_Mail ON
Stuff_Info.D_id = Tel_Mail.D_id


so where is the error
and if it's the wrong forum to ask in plz direct me
Regards
 
You are not syaing what to select put a star between Select and from and that
will select everything
 
Hi Tota,

Please do not use u and & as substitute for words. It makes your text
harder to read when there are spelling errors as well.

You aren't telling the database what you want.

SELECT <columns> FROM <datatable> ...

So when you aren't specifying any columns you will get an error near FROM.
Specify individual columns or use * (SELECT * FROM ...).

Btw, since this isn't related to C#, I would imagine the ADO.NET news
group to be better :)
 
Tota,

I hate SQL however on first sight I think that you have to select something.

Select whatever From ...........................................

Just for your information, a newsgroup very much affected with this is
microsoft.dotnet.framework.adonet

I hope this helps something

Cor
 
Back
Top