Click here to Skip to main content
16,005,389 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: access to outlook inbox Pin
pnpfriend10-Aug-03 4:57
pnpfriend10-Aug-03 4:57 
Generalprinting to the printer with vb.net Pin
yulyos7-Aug-03 6:04
yulyos7-Aug-03 6:04 
GeneralRe: printing to the printer with vb.net Pin
pnpfriend7-Aug-03 10:21
pnpfriend7-Aug-03 10:21 
GeneralRe: printing to the printer with vb.net Pin
yulyos7-Aug-03 20:57
yulyos7-Aug-03 20:57 
GeneralRe: printing to the printer with vb.net Pin
pnpfriend8-Aug-03 5:50
pnpfriend8-Aug-03 5:50 
GeneralRe: printing to the printer with vb.net Pin
yulyos8-Aug-03 6:06
yulyos8-Aug-03 6:06 
GeneralRe: printing to the printer with vb.net Pin
pnpfriend8-Aug-03 8:48
pnpfriend8-Aug-03 8:48 
GeneralRetreving an auto number field from Access Pin
GrGonzo6-Aug-03 13:50
GrGonzo6-Aug-03 13:50 
Hi all....

I am working on a VB.net application at attaches to a database in disconnected mode. I am haveing trouble retreving an autonumber field. Here is the code as I have it now:

Dim drw1 As DataRow = das3.Tables("tomdb").NewRow()
drw1("Name") = TextBox3.Text
drw1("function") = TextBox4.Text
If RadioButton1.Checked Then
drw1("accesslevel") = "1"
ElseIf RadioButton2.Checked Then
drw1("accesslevel") = "2"
ElseIf RadioButton3.Checked Then
drw1("accesslevel") = "3"
Else
drw1("accesslevel") = "3"
End If
drw1("UserID") = Integer.MaxValue

das3.Tables("tomDB").Rows.Add(drw1)

AddHandler dap3.RowUpdated, New OleDb.OleDbRowUpdatedEventHandler(AddressOf OnRowUpdated)
--------------------------------------------------------------------------------------

Private Sub OnRowUpdated(ByVal sender As Object, ByVal args As OleDb.OleDbRowUpdatedEventArgs)


Dim int1 As Integer = 0
Dim cmd1 As OleDb.OleDbCommand = New OleDb.OleDbCommand("SELECT @@IDENTITY", cnn3)

If args.StatementType = StatementType.Insert Then
int1 = CInt(cmd1.ExecuteScalar())
args.Row("UserID") = int1
End If
End Sub

--------------------------------------------------------------------------------------

In my code it should retreve the next record number but all I get is a 0.

Any ideas?

Gonz



GeneralRe: Retreving an auto number field from Access Pin
Bo Hunter7-Aug-03 14:32
Bo Hunter7-Aug-03 14:32 
GeneralPossible Vb Question Pin
droesch6-Aug-03 7:06
droesch6-Aug-03 7:06 
GeneralRe: Possible Vb Question Pin
RichardGrimmer18-Aug-03 4:07
RichardGrimmer18-Aug-03 4:07 
GeneralExtremly stupid VBA question Pin
Harald Krause6-Aug-03 1:17
Harald Krause6-Aug-03 1:17 
GeneralRe: Extremly stupid VBA question Pin
MrGee6-Aug-03 14:00
MrGee6-Aug-03 14:00 
GeneralRe: Extremly stupid VBA question Pin
RichardGrimmer18-Aug-03 4:08
RichardGrimmer18-Aug-03 4:08 
GeneralRe: Extremly stupid VBA question Pin
Nick Seng6-Aug-03 15:49
Nick Seng6-Aug-03 15:49 
GeneralADODB recordset Pin
_crs_6-Aug-03 0:41
_crs_6-Aug-03 0:41 
GeneralRe: ADODB recordset Pin
RichardGrimmer18-Aug-03 4:10
RichardGrimmer18-Aug-03 4:10 
GeneralVB.Net- C# integration Pin
Madhuri Mittal5-Aug-03 23:27
Madhuri Mittal5-Aug-03 23:27 
GeneralVBA help! Pin
Vladimir Georgiev5-Aug-03 23:17
Vladimir Georgiev5-Aug-03 23:17 
GeneralHardware Manipulation Pin
347Studboy5-Aug-03 13:11
347Studboy5-Aug-03 13:11 
GeneralRe: Hardware Manipulation Pin
pxw16-Aug-03 6:48
pxw16-Aug-03 6:48 
GeneralRe: Hardware Manipulation Pin
MarziehBere27-Jul-10 20:27
MarziehBere27-Jul-10 20:27 
GeneralVB events and Command Buttons Pin
blaze19785-Aug-03 12:15
blaze19785-Aug-03 12:15 
GeneralRe: VB events and Command Buttons Pin
Nick Seng5-Aug-03 16:00
Nick Seng5-Aug-03 16:00 
GeneralRe: VB events and Command Buttons Pin
blaze19786-Aug-03 3:27
blaze19786-Aug-03 3:27 

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.