Click here to Skip to main content
15,909,199 members
Home / Discussions / C#
   

C#

 
AnswerRe: Handling ALT Key on Controls Pin
Christian Graus1-Oct-06 9:55
protectorChristian Graus1-Oct-06 9:55 
GeneralRe: Handling ALT Key on Controls Pin
Vertyg01-Oct-06 10:12
Vertyg01-Oct-06 10:12 
GeneralRe: Handling ALT Key on Controls Pin
Christian Graus1-Oct-06 10:19
protectorChristian Graus1-Oct-06 10:19 
AnswerRe: Handling ALT Key on Controls Pin
Nader Elshehabi1-Oct-06 14:17
Nader Elshehabi1-Oct-06 14:17 
AnswerRe: Handling ALT Key on Controls Pin
Andrei Ungureanu1-Oct-06 21:20
Andrei Ungureanu1-Oct-06 21:20 
QuestionLocation and access method for global connection strings Pin
PeteConc1-Oct-06 5:26
PeteConc1-Oct-06 5:26 
AnswerRe: Location and access method for global connection strings Pin
S. Senthil Kumar1-Oct-06 9:37
S. Senthil Kumar1-Oct-06 9:37 
Questionhelp with data access Pin
Mridang Agarwalla1-Oct-06 1:20
Mridang Agarwalla1-Oct-06 1:20 
Dim loConn, lsSQL, loRs
Set loConn = CreateObject("ADODB.Connection")

' Open a connection to the database
loConn.Open("DSN=myDSN;UID=something;PWD=Something;")

' Insert a new record into the table
lsSQL = "SET NOCOUNT ON;" &_
"INSERT INTO tMembers (MemberName) VALUES ('Manohar');" &_
"SELECT @@IDENTITY AS NewID;"

' Execute the SQL statement
Set loRs = loConn.Execute(lsSQL)

' Get the inserted ID
llID = loRs.Fields("NewID").value

' Close the connection
loConn.Close()
Set loConn = Nothing

Hi guys,
What would be the equivalent code of the the above in C#? I have used ADO.NET a bit. How would i have to access the returend value (NewID). Would i have to pouplate a dataset or something? Is there a simple way to access single values returned by a database such as

SELECT DISTINCT store_name FROM Store_Information WHERE id = 5

Thanks!


AnswerRe: help with data access Pin
Rob Graham1-Oct-06 4:39
Rob Graham1-Oct-06 4:39 
QuestionZip Folder [modified] Pin
dehghan198430-Sep-06 23:59
dehghan198430-Sep-06 23:59 
AnswerRe: Zip Folder Pin
User 66581-Oct-06 0:30
User 66581-Oct-06 0:30 
AnswerRe: Zip Folder Pin
Hamid_RT2-Oct-06 9:33
Hamid_RT2-Oct-06 9:33 
Questiontimers in services Pin
sianatia30-Sep-06 23:03
sianatia30-Sep-06 23:03 
AnswerRe: timers in services Pin
Stefan Troschuetz30-Sep-06 23:21
Stefan Troschuetz30-Sep-06 23:21 
QuestionControls's array Pin
t_nedelchev30-Sep-06 22:07
t_nedelchev30-Sep-06 22:07 
AnswerRe: Controls's array Pin
Stefan Troschuetz30-Sep-06 22:17
Stefan Troschuetz30-Sep-06 22:17 
GeneralRe: Controls's array Pin
t_nedelchev30-Sep-06 23:06
t_nedelchev30-Sep-06 23:06 
GeneralRe: Controls's array Pin
Stefan Troschuetz30-Sep-06 23:17
Stefan Troschuetz30-Sep-06 23:17 
GeneralRe: Controls's array Pin
t_nedelchev1-Oct-06 1:23
t_nedelchev1-Oct-06 1:23 
Questionkeys events Pin
Kola Sokol30-Sep-06 22:05
Kola Sokol30-Sep-06 22:05 
AnswerRe: keys events Pin
Stefan Troschuetz30-Sep-06 22:29
Stefan Troschuetz30-Sep-06 22:29 
GeneralRe: keys events Pin
Kola Sokol30-Sep-06 22:36
Kola Sokol30-Sep-06 22:36 
GeneralRe: keys events Pin
Stefan Troschuetz30-Sep-06 22:47
Stefan Troschuetz30-Sep-06 22:47 
GeneralRe: keys events Pin
Kola Sokol30-Sep-06 23:36
Kola Sokol30-Sep-06 23:36 
GeneralRe: keys events Pin
Stefan Troschuetz30-Sep-06 23:55
Stefan Troschuetz30-Sep-06 23:55 

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.