473,387 Members | 1,603 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Connection

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
Nov 16 '05 #1
3 1138
You are not syaing what to select put a star between Select and from and that
will select everything

"Tota" wrote:
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

Nov 16 '05 #2
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 :)

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #3
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
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: G-Fit | last post by:
Hello group, I have several servers hosting SQL databases. On each of them, I have several databases. All those databases have the same structure (even those on different servers), only the data...
11
by: pradeep_TP | last post by:
Hi all, I have a few questions that I have been wanting to ask for long. These are all related to ADO.net and specifically to conenction to database. 1) If I have opened a connection to a...
6
by: Chris Szabo | last post by:
I've created a data access layer for a .NET web application. I'm using C# and framework 1.1. I'm getting an error from time to time when I close a connection saying: ...
18
by: Rob Nicholson | last post by:
We're getting an occasional occurrence of the following error when two users try and open the same record in our ASP.NET app: "There is already an open DataReader associated with this Connection...
35
by: Eric Sabine | last post by:
In my Finally block, I was using cn.close (where cn is an ADO.NET connection object, SQLConnection to be exact) and then I came across the following in some microsoft code. If Not cn Is Nothing...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
3
by: fniles | last post by:
In the Windows application (using VB.NET 2005) I use connection pooling like the following: In the main form load I open a connection using a connection string that I stored in a global variable...
0
by: Robert Avery | last post by:
In VBA/VB6, I had a class (incomplete sample below) that watched and displayed for the user all connection events, so that I could easily see what SQL was taking a long time, and when it freezes, I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.