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

New Message on BDOTNET

-----------------------------------------------------------
From: Aspnetstarter1
Message 4 in Discussion

Hi all   here is the code   '----------------  
Dim updateTrans As SqlClient.SqlTransaction 
Dim con As New SqlClient.SqlConnection(strCon) 
con.Open() 
Dim CmdStructure As New SqlClient.SqlCommand("update_STRUCTURE", con) 
CmdStructure.CommandType = CommandType.StoredProcedure 
updateTrans = con.BeginTransaction(IsolationLevel.RepeatableRead) 
CmdStructure.Transaction = updateTrans 
Try 
CmdStructure.Parameters.Add("@STRUCTURE_ID", SqlDbType.VarChar, 12).Value = 
m_PropertyId 
If s_txtDateBuilt <> "" Then 
CmdStructure.Parameters.Add("@DATE_BUILT", SqlDbType.DateTime).Value = 
DateTime.Parse(s_txtDateBuilt) 
Else 
CmdStructure.Parameters.Add("@DATE_BUILT", SqlDbType.DateTime).Value = m_sqlDateNull 
End If 
CmdStructure.Parameters.Add("@OCCUPANCY", SqlDbType.VarChar, 20).Value = 
s_txtOccupancy 
CmdStructure.Parameters.Add("@SQ_FEET", SqlDbType.Decimal).Value = CDbl(s_txtSqFeet) 
CmdStructure.Parameters.Add("@NUM_OF_STORIES", SqlDbType.Int).Value = s_txtNoOfStories 
CmdStructure.Parameters.Add("@PERCENT_SPRINKLER", SqlDbType.Decimal).Value = 
CDbl(s_txtSprinklerPct) 
CmdStructure.Parameters.Add("@WALL_CONSTRUCTION", SqlDbType.VarChar, 20).Value = 
s_txtWallConst 
CmdStructure.Parameters.Add("@ROOF_CONSTRUCTION", SqlDbType.VarChar, 20).Value = 
s_txtRoofConst 
CmdStructure.Parameters.Add("@COMMENTS", SqlDbType.VarChar, 255).Value = s_txtComments 
CmdStructure.ExecuteNonQuery() 
updateTrans.Commit() 
UpdateStructureProperty = True 
Catch ex As Exception 
updateTrans.Rollback() 
m_ErrMsg = ex.Message 
UpdateStructureProperty = False 
End Try 
con.Close() 
con = Nothing 
Return UpdateStructureProperty '----------------   ' The front end code is as follows  
With objSys 
PropertyID = "S-KS-000001" 
s_txtDateBuilt = "11/04/03" 
s_txtOccupancy = "TEst occupancy" 
s_txtSqFeet = Val(6) 
s_txtNoOfStories = Val(12) 
s_txtSprinklerPct = Val(200) 
s_txtWallConst = "Constructed on 10/03/03" 
s_txtRoofConst = "Moulded on 10/06/03" 
s_txtComments = "TEst update for structure" 
If Not UpdateStructureProperty("Server=BNG-SERVER;Database=REMS;uid=sa;") Then 
MsgBox("update fails") 
Else 
MsgBox("update succes") 
End If 
End With '****************

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

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to