Escolar Documentos
Profissional Documentos
Cultura Documentos
ConnectionString =
("Server=192.9.202.166;uid=sa;pwd=pwd;database=power_view")
conn.ConnectionString =
("Server=192.9.202.72;uid=sa;pwd=pwd;database=power_view")
Dim uid, brkname, scrptname, qty, buyrate, broakrage, exchange, type,
expdate, optiontype, stkprice As String
Try
uid = guserid
brkname = broakernamecombo.Text
scrptname = Scriptcombo.Text
qty = Qtytb.Text
buyrate = buyratetb.Text
broakrage = brokragecombo.Text
exchange = comboexchange.Text
If RadioButton1.Checked = True Then
type = RadioButton1.Text
End If
If RadioButton2.Checked = True Then
type = RadioButton2.Text
End If
If RadioButton3.Checked = True Then
type = RadioButton3.Text
End If
expdate = expirydatecombo.Text
optiontype = optiontypecombo.Text
stkprice = strikepricecombo.Text
If stkprice = "Data Not Found" Then
stkprice = 0
End If
conn.Open()
cmd.CommandText = "insert into Dp values ('" & uid & "','" & brkname &
"','" & scrptname & "'," & qty & "," & buyrate & "," & broakrage & ",'" & exchange
& "','" & type & "','" & expdate & "','" & optiontype & "'," & stkprice & ")"
cmd.CommandType = CommandType.Text
cmd.Connection = conn
cmd.ExecuteNonQuery()
MessageBox.Show("data save successfully")
Me.Close()
Catch ex As Exception
MsgBox(ex.Message)
cmd.Connection.Close()
End Try
End Sub
Private Sub Closebutt_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Closebutt.Click
Me.Close()
End Sub
Else
comboexchange.Text = "NSE"
RadioButton1.Focus()
expirydatecombo.Enabled = False
optiontypecombo.Enabled = False
strikepricecombo.Enabled = False
RadioButton1.Enabled = True
RadioButton2.Enabled = True
RadioButton3.Enabled = True
End If
End Sub
optiontypecombo.Enabled = False
strikepricecombo.Enabled = False
expirydatecombo.Enabled = True
optiontypecombo.Text = ""
strikepricecombo.Text = ""
Qtytb.Text = ""
buyratetb.Text = ""
End If
QtyMessage.Text = ""
BuyrateMessage.Text = ""
BroakrageMessage.Text = ""
expdatemessage.Text = ""
optmessage.Text = ""
strikepmessage.Text = ""
Qtytb.Text = ""
buyratetb.Text = ""
End If
End Sub
QtyMessage.Text = ""
BuyrateMessage.Text = ""
BroakrageMessage.Text = ""
'expdatemessage.Text = ""
'optmessage.Text = ""
'strikepmessage.Text = ""
End Sub
End If
End If
strikepricecombo.Focus()
If strikepricecombo.Text.Length = 0 Then
strikepricecombo.Text = "Data Not Found"
End If
End Sub
End Class