Click here to Skip to main content
15,903,201 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Application Path Pin
Trupti Mehta11-Sep-07 0:38
Trupti Mehta11-Sep-07 0:38 
AnswerRe: Application Path Pin
Guffa11-Sep-07 2:41
Guffa11-Sep-07 2:41 
GeneralRe: Application Path Pin
Trupti Mehta11-Sep-07 19:54
Trupti Mehta11-Sep-07 19:54 
AnswerRe: Application Path Pin
Guffa11-Sep-07 21:45
Guffa11-Sep-07 21:45 
GeneralRe: Application Path Pin
Trupti Mehta11-Sep-07 22:59
Trupti Mehta11-Sep-07 22:59 
QuestionChanging database source for Crystal Reports Pin
DarynRoberts9-Sep-07 22:26
DarynRoberts9-Sep-07 22:26 
AnswerRe: Changing database source for Crystal Reports Pin
Paul Conrad16-Sep-07 8:31
professionalPaul Conrad16-Sep-07 8:31 
QuestionWhat is the Syntaxt to update Database Record in Windows Application? Validate Composite Primary Key ? Pin
Raeem9-Sep-07 22:12
Raeem9-Sep-07 22:12 
Dear you are really special to me and you have made good experience in vb.net windows application. I am a beginner. I have a problem to update Database Record from in my Windows application. Hope you may help me.
My source table has more than one column have primary key (composite primary key) if I have only one Column set as Primary Key I can update and Delete Database Record.

But My Database table using 4 columns as Primary Key how to validate the primary key while checking the record is exist? In Where condition?
I write the code below. Pleas help me to solve my small Problem and you will be appreciated.
Thanking you.


Private Sub Cmd_Save_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Cmd_Save.Click
Dim sql As String
sql = " Select * From ICECREAM_TRANSACTIONS order by Ice_Seq"
Dim Adp_1 As New OleDb.OleDbDataAdapter(sql, Cn_Def)

If Status Then
If Trim(Me.Comb_IDMASTER.Text) <> Nothing AndAlso IsNumeric(Me.Comb_IDMASTER.Text) Then
If Trim(Me.Cmb_Fish_Code.Text) <> Nothing AndAlso IsNumeric(Me.Cmb_ice_Code.Text) Then
If Trim(Me.DTP_icecream_DATMASTER.Text) <> Nothing AndAlso IsDate(Me.DTP_icecream_DATMASTER.Text) Then
If Trim(Me.CMB_MKT_CODEMASTER.Text) <> Nothing AndAlso IsNumeric(Me.CMB_MKT_CODEMASTER.Text) Then

If Not Found_Prim("ICECREAM_TRANSACTIONS", "ICE_SEQ", " & Val(Me.Comb_IDMASTER.Text) & " And "ICE_CODE", "& Val(Me.Cmb_Ice_Code.Text) & " And "ICETRN_DAT", "Me.DTP_ICETRN_DATMASTER.Text" And "MKT_CODE", "& Val(Me.CMB_MKT_CODEMASTER.Text)&") Then

CMDS.Exec(Cn_Def, "Insert into ICECREAM_TRANSACTIONS(Ice_Seq,Ice_Code,ICETRN_DAT,MKT_CODE,QTY,WHOLSALE_PRICE,RETAIL_PRICE,NATURE,EXPORT,IMPORT) Values(?,?,?,?,?,?,?,?,?,?)", _
New Object() {Val(Me.Comb_IDMASTER.Text), Val(Me.Cmb_Ice_Code.Text), Me.DTP_ICETRN_DATMASTER.Text, Val(Me.CMB_MKT_CODEMASTER.Text), Val(Me.Txt_QTY.Text), Val(Me.Txt_WHOLSALE_PRICE.Text), Val(Me.Txt_RETAIL_PRICE.Text), Me.TXT_NATURE.Text, Me.CHK_EXPORT.Checked, Me.CHK_IMPORTED.Checked})
MsgBox("New Record Added into the Database " & vbCrLf & "___________" & vbCrLf & vbCrLf & "Insert a New Record", MsgBoxStyle.Information, Me.Text)
Clear_Txt()
Else
CMDS.Exec(Cn_Def, "Update ICE_TRANSACTIONS set ICE_SEQ=?,ICE_CODE=?,ICETRN_DAT=?,MKT_CODE=?,QTY=?,WHOLESALE_PRICE=?,RETAIL_PRICE=?,TOTAL_PRICE=?,NATURE=?,EXPORT=?,IMPORT=? Where ICE_SEQ=" & Me.Comb_ICE_SEQ.Text& "AND ICE_CODE = " & Me.Cmb_Ice_Code.Text &" AND ICETRN_DAT= "& Me.DTP_ICETRN_DAT.Text &" AND MKT_CODE = "& Me.CMB_MKT_CODEMASTER.Tex&" 'New Object() {Me.Comb_ICE_SEQ.Text, Me.Cmb_ICE_Code.Text, Me.DTP_ICETRN_DAT.Text, Me.Txt_MKT_CODE.Text, Val(Me.Txt_QTY.Text), Val(Me.Txt_WHOLSALE_PRICE.Text), Val(Me.Txt_RETAIL_PRICE.Text), Me.TXT_NATURE.Text, Me.CHK_EXPORT.Checked, Me.CHK_IMPORTED.Checked})
Cmd_Cancle_Click(sender, e)
End If
End If
End If
End If
End If
Else
End Sub


Rameel Rahim India
QuestionPlease help me with DateTimePicker ShowCheckBox property in GridView. Pin
pcphuc9-Sep-07 21:03
pcphuc9-Sep-07 21:03 
AnswerRe: Please help me with DateTimePicker ShowCheckBox property in GridView. Pin
rohitsrivastava11-Sep-07 0:16
rohitsrivastava11-Sep-07 0:16 
GeneralRe: Please help me with DateTimePicker ShowCheckBox property in GridView. Pin
pcphuc11-Sep-07 0:21
pcphuc11-Sep-07 0:21 
QuestionClean closing Pin
Kevnar9-Sep-07 20:01
Kevnar9-Sep-07 20:01 
AnswerRe: Clean closing Pin
Trupti Mehta9-Sep-07 20:20
Trupti Mehta9-Sep-07 20:20 
GeneralRe: Clean closing Pin
Kevnar9-Sep-07 23:02
Kevnar9-Sep-07 23:02 
AnswerRe: Clean closing Pin
Trupti Mehta9-Sep-07 23:20
Trupti Mehta9-Sep-07 23:20 
AnswerRe: Clean closing Pin
ChandraRam10-Sep-07 0:59
ChandraRam10-Sep-07 0:59 
AnswerRe: Clean closing Pin
Kevnar11-Sep-07 1:03
Kevnar11-Sep-07 1:03 
Questionmajor project in visual basic Pin
vishal dhir9-Sep-07 19:39
vishal dhir9-Sep-07 19:39 
AnswerRe: major project in visual basic Pin
The ANZAC9-Sep-07 22:03
The ANZAC9-Sep-07 22:03 
AnswerRe: major project in visual basic Pin
Dave Kreskowiak10-Sep-07 1:58
mveDave Kreskowiak10-Sep-07 1:58 
QuestionHow to recover delete files from Hard Disk Pin
Software_Guy_1239-Sep-07 18:50
Software_Guy_1239-Sep-07 18:50 
AnswerRe: How to recover delete files from Hard Disk Pin
Dave Kreskowiak10-Sep-07 1:54
mveDave Kreskowiak10-Sep-07 1:54 
GeneralRe: How to recover delete files from Hard Disk Pin
Software_Guy_12310-Sep-07 18:35
Software_Guy_12310-Sep-07 18:35 
QuestionScope of a variable Pin
ASPnoob9-Sep-07 17:53
ASPnoob9-Sep-07 17:53 
AnswerRe: Scope of a variable Pin
Mark Churchill9-Sep-07 18:39
Mark Churchill9-Sep-07 18:39 

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.