Click here to Skip to main content
16,005,552 members
Home / Discussions / Web Development
   

Web Development

 
Generalcsv import cannot find file on desktop Pin
orangetree20-Jan-05 16:12
orangetree20-Jan-05 16:12 
QuestionHow to integrate C++ application with ASP.net Web Application? Pin
webdevelopex19-Jan-05 15:37
webdevelopex19-Jan-05 15:37 
AnswerRe: How to integrate C++ application with ASP.net Web Application? Pin
V.20-Jan-05 22:29
professionalV.20-Jan-05 22:29 
GeneralJavaScript + dll howto... Pin
spaceus19-Jan-05 10:32
spaceus19-Jan-05 10:32 
GeneralDatabase Pin
Yulianto.18-Jan-05 18:01
Yulianto.18-Jan-05 18:01 
GeneralRe: Database Pin
Colin Angus Mackay19-Jan-05 4:46
Colin Angus Mackay19-Jan-05 4:46 
GeneralRe: Database Pin
Yulianto.19-Jan-05 16:04
Yulianto.19-Jan-05 16:04 
GeneralRe: Database Pin
Colin Angus Mackay19-Jan-05 22:03
Colin Angus Mackay19-Jan-05 22:03 
Assuming you use the stored procedure I put in my previous post. If you use the SqlCommand.ExecuteNonQuery()[^] method the return value indicates the number of rows affected. If the record was inserted it will return 1, if not it will return 0.

If you want to just run an INSERT command directly through SqlCommand to the database then you can enclose ExecuteNonQuery() in a try catch block.
try
{
    myCommand.ExecuteNonQuery();
}
catch(SqlException e)
{
    // Something went wrong, deal with it here
}
finally
{
    myCommand.Connection.Close();
}


Does this help?


Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums


Upcoming talk:
SELECT UserName, Password FROM Users
-- Getting unauthorised access to a SQL Server, and how to prevent it.

GeneralRe: Database Pin
Yulianto.21-Jan-05 14:29
Yulianto.21-Jan-05 14:29 
GeneralRe: Database Pin
Colin Angus Mackay21-Jan-05 14:36
Colin Angus Mackay21-Jan-05 14:36 
GeneralRe: Database Pin
mtone26-Jan-05 3:36
mtone26-Jan-05 3:36 
GeneralEvent not firing in composite control Pin
ttapping18-Jan-05 15:20
ttapping18-Jan-05 15:20 
GeneralRe: Event not firing in composite control Pin
epatton20-Jan-05 2:49
epatton20-Jan-05 2:49 
GeneralRe: Event not firing in composite control Pin
ttapping21-Jan-05 18:06
ttapping21-Jan-05 18:06 
GeneralAccessing child page function through JavaScript Pin
Hemant Mane18-Jan-05 4:48
Hemant Mane18-Jan-05 4:48 
GeneralRe: Accessing child page function through JavaScript Pin
JKroschel25-Jan-05 8:01
JKroschel25-Jan-05 8:01 
GeneralException thrown when use IOleContainer::EnumObjects function Pin
mayforest18-Jan-05 1:17
mayforest18-Jan-05 1:17 
QuestionHow to determine if IIS is already installed Pin
exhaulted18-Jan-05 1:01
exhaulted18-Jan-05 1:01 
Generalinstall process...web based Pin
oxygen_fiend17-Jan-05 10:38
oxygen_fiend17-Jan-05 10:38 
GeneralRe: install process...web based Pin
raouls17-Jan-05 20:45
raouls17-Jan-05 20:45 
GeneralRe: install process...web based Pin
johnhebert18-Jan-05 6:22
johnhebert18-Jan-05 6:22 
Generaldownload file for one time using GPRS Pin
manasrahfantom17-Jan-05 3:17
manasrahfantom17-Jan-05 3:17 
Generalusing ASP/VB script how to write/copy a text file from a server to client machine Pin
nbiju16-Jan-05 20:28
nbiju16-Jan-05 20:28 
GeneralRe: using ASP/VB script how to write/copy a text file from a server to client machine Pin
raouls16-Jan-05 21:16
raouls16-Jan-05 21:16 
GeneralRe: using ASP/VB script how to write/copy a text file from a server to client machine Pin
nbiju16-Jan-05 21:21
nbiju16-Jan-05 21:21 

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.