Click here to Skip to main content
15,913,939 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralEXPORTING CRYSTAL REPORTS! HELP ME! PLEASE! Pin
mizu_chil11-Jun-05 15:46
mizu_chil11-Jun-05 15:46 
GeneralRe: EXPORTING CRYSTAL REPORTS! HELP ME! PLEASE! Pin
Yulianto.12-Jun-05 22:10
Yulianto.12-Jun-05 22:10 
GeneralRe: EXPORTING CRYSTAL REPORTS! HELP ME! PLEASE! Pin
Anonymous13-Jun-05 2:18
Anonymous13-Jun-05 2:18 
GeneralRe: EXPORTING CRYSTAL REPORTS! HELP ME! PLEASE! Pin
Yulianto.13-Jun-05 16:59
Yulianto.13-Jun-05 16:59 
QuestionAdd DLL reference during runtime? Pin
Chemisus11-Jun-05 8:32
Chemisus11-Jun-05 8:32 
AnswerRe: Add DLL reference during runtime? Pin
S. Senthil Kumar12-Jun-05 5:53
S. Senthil Kumar12-Jun-05 5:53 
GeneralAuto Number Generator Pin
LordLothar11-Jun-05 5:41
LordLothar11-Jun-05 5:41 
GeneralRe: Auto Number Generator Pin
Robert Rohde11-Jun-05 20:37
Robert Rohde11-Jun-05 20:37 
Hi,

first of all: If your periodno is unique you won't need the loop.
To your question: If you don't have any entries in the Period table the Select function will return an empty array:

PeriodAdapter.Fill(DataSet11, "period")
Dim datatable As DataTable = DataSet11.Tables("Period")
Dim dr As DataRow = datatable.NewRow

Dim r() As DataRow = datatable.Select("periodno= max(periodno)")
Dim nextPeriodNo as Integer
If (r.Length == 0) Then
nextPeriodNo = 1
Else
nextPeriodNo = CInt(r(i)("periodno")) + 1
End If
Dim i As Integer

dr("periodno") = nextPeriodNo 
dr("begindate") = DateTimePicker1.Value.Date
dr("enddate") = DateTimePicker2.Value.Date
datatable.Rows.Add(dr)

MsgBox("New period has been saved", MsgBoxStyle.Information, "New Period")
PeriodAdapter.Update(DataSet11, "period")

GeneralPassword protected folder Pin
Rizwan Bashir11-Jun-05 2:50
Rizwan Bashir11-Jun-05 2:50 
GeneralRe: Password protected folder Pin
Dave Kreskowiak11-Jun-05 3:15
mveDave Kreskowiak11-Jun-05 3:15 
Generaltext to image Pin
Rizwan Bashir11-Jun-05 2:04
Rizwan Bashir11-Jun-05 2:04 
GeneralRe: text to image Pin
S. Senthil Kumar12-Jun-05 5:55
S. Senthil Kumar12-Jun-05 5:55 
GeneralString Encryption. [VB6] Pin
Smurg11-Jun-05 0:41
Smurg11-Jun-05 0:41 
Generalput Flash into form Pin
GaryKoh11-Jun-05 0:12
GaryKoh11-Jun-05 0:12 
GeneralRe: put Flash into form Pin
KaptinKrunch12-Jun-05 15:46
KaptinKrunch12-Jun-05 15:46 
GeneralRe: put Flash into form Pin
kevinssi12-Jun-05 22:04
kevinssi12-Jun-05 22:04 
QuestionHow to save latest input? Pin
LordLothar10-Jun-05 20:31
LordLothar10-Jun-05 20:31 
AnswerRe: How to save latest input? Pin
Yulianto.10-Jun-05 20:55
Yulianto.10-Jun-05 20:55 
AnswerRe: How to save latest input? Pin
syed saba10-Jun-05 20:55
syed saba10-Jun-05 20:55 
GeneralRe: How to save latest input? Pin
LordLothar11-Jun-05 5:50
LordLothar11-Jun-05 5:50 
GeneralRe: How to save latest input? Pin
MohammadAmiry12-Jun-05 23:42
MohammadAmiry12-Jun-05 23:42 
GeneralRe: How to save latest input? Pin
LordLothar13-Jun-05 2:53
LordLothar13-Jun-05 2:53 
GeneralSimple? Problem Pin
Lordahdaring10-Jun-05 18:32
Lordahdaring10-Jun-05 18:32 
GeneralRe: Simple? Problem Pin
Dave Kreskowiak11-Jun-05 3:10
mveDave Kreskowiak11-Jun-05 3:10 
GeneralRe: Simple? Problem Pin
Lordahdaring11-Jun-05 15:21
Lordahdaring11-Jun-05 15: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.