Click here to Skip to main content
15,895,746 members
Home / Discussions / Database
   

Database

 
GeneralCheck to see if a Table exists Pin
Wilye26-Jun-05 10:14
Wilye26-Jun-05 10:14 
GeneralRe: Check to see if a Table exists Pin
Colin Angus Mackay26-Jun-05 11:54
Colin Angus Mackay26-Jun-05 11:54 
GeneralRe: Check to see if a Table exists Pin
toxcct27-Jun-05 6:17
toxcct27-Jun-05 6:17 
GeneralRe: Check to see if a Table exists Pin
Bruzak27-Jun-05 19:55
Bruzak27-Jun-05 19:55 
GeneralRe: Check to see if a Table exists Pin
Wilye28-Jun-05 2:55
Wilye28-Jun-05 2:55 
GeneralOLEDB COMMANDS Pin
02088326-Jun-05 9:42
02088326-Jun-05 9:42 
GeneralGet ID Problem Pin
WDI26-Jun-05 7:35
WDI26-Jun-05 7:35 
GeneralRe: Get ID Problem Pin
Colin Angus Mackay26-Jun-05 12:02
Colin Angus Mackay26-Jun-05 12:02 
WDI wrote:
"insert into T(a,b) values (@a,@b);"+"select @@IDENTITY as '" + "a" + "'";

This is nuts. Why are you concatenating string literals like this? You could do all this in one literal string:
insert into T(a,b) values (@a,@b);select @@IDENTITY as 'a'
And as you can see this is much easier to read. I suspect there is something more going on here because you are unlikely to have a table named T with columns name a and b. So, we cannot see what your proper string is, which is the cause of your problem, because you have chosen to obfuscate it. This does not help us help you. If you need to obfuscate parts of the code then do that to code that is incidental to the problem, not directly related to it.

Next, what is this as 'a' on the end. I'm guessing this will confuse the query parser because the apostrophe is for string literals in SQL, not for naming columns. Use [a] or "a" - better yet, because you are using ExecuteScalar, don't name the column at all.


My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More


Generalserver registration problem Pin
Anonymous26-Jun-05 2:50
Anonymous26-Jun-05 2:50 
GeneralRe: server registration problem Pin
Anonymous26-Jun-05 9:33
Anonymous26-Jun-05 9:33 
GeneralInsert problem Pin
Blue_Skye25-Jun-05 17:08
Blue_Skye25-Jun-05 17:08 
GeneralRe: Insert problem Pin
Luis Alonso Ramos25-Jun-05 17:20
Luis Alonso Ramos25-Jun-05 17:20 
GeneralRe: Insert problem Pin
Blue_Skye26-Jun-05 1:44
Blue_Skye26-Jun-05 1:44 
GeneralRe: Insert problem Pin
Luis Alonso Ramos26-Jun-05 5:31
Luis Alonso Ramos26-Jun-05 5:31 
GeneralRe: Insert problem Pin
toxcct26-Jun-05 7:33
toxcct26-Jun-05 7:33 
GeneralRe: Insert problem Pin
Luis Alonso Ramos26-Jun-05 9:12
Luis Alonso Ramos26-Jun-05 9:12 
GeneralRe: Insert problem Pin
Blue_Skye26-Jun-05 20:13
Blue_Skye26-Jun-05 20:13 
GeneralRe: Insert problem Pin
Luis Alonso Ramos27-Jun-05 5:15
Luis Alonso Ramos27-Jun-05 5:15 
GeneralRe: Insert problem Pin
Blue_Skye26-Jun-05 7:40
Blue_Skye26-Jun-05 7:40 
GeneralRe: Insert problem Pin
Luis Alonso Ramos26-Jun-05 9:13
Luis Alonso Ramos26-Jun-05 9:13 
Generalupdating a database Pin
steve_rm25-Jun-05 2:01
steve_rm25-Jun-05 2:01 
Generalvariable queries for vb.net Pin
WetRivrRat24-Jun-05 22:37
WetRivrRat24-Jun-05 22:37 
GeneralRe: variable queries for vb.net Pin
Colin Angus Mackay25-Jun-05 2:38
Colin Angus Mackay25-Jun-05 2:38 
GeneralRe: variable queries for vb.net Pin
WetRivrRat27-Jun-05 2:40
WetRivrRat27-Jun-05 2:40 
Generalhello,sqldatabase registering error Pin
Anonymous24-Jun-05 10:53
Anonymous24-Jun-05 10:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.