Click here to Skip to main content
15,902,635 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: School Calendar using VB.Net Pin
0x3c010-Mar-09 7:04
0x3c010-Mar-09 7:04 
GeneralRe: School Calendar using VB.Net Pin
wr302810-Mar-09 18:31
wr302810-Mar-09 18:31 
GeneralRe: School Calendar using VB.Net Pin
wr302810-Mar-09 18:54
wr302810-Mar-09 18:54 
QuestionHighlight the background color Pin
BalasubramanianK9-Mar-09 20:02
BalasubramanianK9-Mar-09 20:02 
AnswerRe: Highlight the background color Pin
0x3c09-Mar-09 21:10
0x3c09-Mar-09 21:10 
GeneralRe: Highlight the background color Pin
BalasubramanianK9-Mar-09 23:30
BalasubramanianK9-Mar-09 23:30 
Questionabout web.config Pin
rajmca.g9-Mar-09 19:42
rajmca.g9-Mar-09 19:42 
QuestionProblem with auto increment. Pin
nazimghori9-Mar-09 18:11
nazimghori9-Mar-09 18:11 
hello every one

I am having problem with increment, I want that regi_code declared below should be auto increment for that I
I am using SQLServer 2005 as my back end.
I wrote code as :-

Dim newid As Integer = Val(obj.getvalsfrmtbl("select max(regi_code) from regi_mast")) + 1
Me.txt4.Text = newid
Me.txt4.Enabled = False

now the problem is it returns me value "1"

this obj.getvalsfrmtbl is a function declared in class for getting one by one values from database

eg:=
Public Function getvalsfrmtbl(ByVal str) As String
Try
Dim res As String = ""
If cn.State = ConnectionState.Open Then
cn.Close()
End If
cn.Open()
Dim cmd As New SqlCommand
Dim dr As SqlDataReader
dr = cmd.ExecuteReader

If dr.HasRows = True Then
dr.Read()
res = dr.Item(0)
Else
res = ""

End If
dr.Close()
cn.Close()
Return res

Catch ex As Exception
Return 0
Finally
cn.Close()
End Try
End Function

if same thing i do with access as bac kend it worked but I need it to work with SQLServer 2005..

so, please help me....

I am beginner.... Smile | :) Smile | :)
AnswerRe: Problem with auto increment. Pin
dan!sh 9-Mar-09 18:17
professional dan!sh 9-Mar-09 18:17 
AnswerRe: Problem with auto increment. Pin
rajmca.g9-Mar-09 19:57
rajmca.g9-Mar-09 19:57 
GeneralRe: Problem with auto increment. Pin
nazimghori9-Mar-09 20:36
nazimghori9-Mar-09 20:36 
QuestionCetak Maklumat Pin
missgarfield9-Mar-09 18:09
missgarfield9-Mar-09 18:09 
AnswerRe: Cetak Maklumat Pin
dan!sh 9-Mar-09 18:10
professional dan!sh 9-Mar-09 18:10 
AnswerRe: Cetak Maklumat Pin
CPallini10-Mar-09 4:12
mveCPallini10-Mar-09 4:12 
Questionvb dot net Pin
anandkumarrs69-Mar-09 18:07
anandkumarrs69-Mar-09 18:07 
AnswerRe: vb dot net Pin
dan!sh 9-Mar-09 18:09
professional dan!sh 9-Mar-09 18:09 
AnswerRe: vb dot net Pin
Christian Graus9-Mar-09 18:32
protectorChristian Graus9-Mar-09 18:32 
Questionfail to add data into database... Pin
zaimah9-Mar-09 17:43
zaimah9-Mar-09 17:43 
AnswerRe: fail to add data into database... Pin
Yusuf9-Mar-09 17:53
Yusuf9-Mar-09 17:53 
GeneralRe: fail to add data into database... Pin
zaimah9-Mar-09 18:03
zaimah9-Mar-09 18:03 
GeneralRe: fail to add data into database... Pin
Christian Graus9-Mar-09 18:32
protectorChristian Graus9-Mar-09 18:32 
GeneralRe: fail to add data into database... Pin
zaimah9-Mar-09 18:53
zaimah9-Mar-09 18:53 
QuestionFormat Numbers in Visual Basic Listbox Pin
NMIB9-Mar-09 10:26
NMIB9-Mar-09 10:26 
AnswerRe: Format Numbers in Visual Basic Listbox Pin
0x3c09-Mar-09 10:56
0x3c09-Mar-09 10:56 
AnswerRe: Format Numbers in Visual Basic Listbox Pin
supercat99-Mar-09 11:29
supercat99-Mar-09 11:29 

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.