MyData.vb

xiaoxiao2021-03-06  61

============= MyData.vbimports system.dataimports system.data.oledbimports system.textimports system.web.httpRequest

Public Class MyData

'********************************************************** ********** 'Recruitment increase' ******************************************* ********************** BYVAL TITLE AS STRINGER, BYVAL TITLE AS STRING, BYVAL BOVAL needno As Integer, ByVal other As String, ByVal ip As String) Dim myconnection As New OleDbConnection (CommunityGlobals.ConnectionString) myconnection.Open () Dim mycommand As New OleDbCommand ( "insert into job (rootid, layer, title, body, needno, Other, UpdateTime, IP) Values ​​(@ rootid, @ @ @ @ @ body, @ Needno, @ @ @ Updatetime, @ ip) ", myconnection) mycommand.parameters.add (" @ rootid ", rootid) MyCommand .Parameters.add ("@ Layer", Layer Mycommand.Parameters.Add ("@ titler", title) mycomb.Parameters.add ("@ body", body) mycommand.parameters.add ("@ Needno", Needno ) Mycommand.Parameters.Add ("@", @ @ "", @ Updatetime, DateTime.now) MyComma Nd.Parameters.Add ("@ ip", IP) MyCommand.executenonQuery () MyConnection.close () end sub '****************************************************** **********************************************************

*********************************************************** ********* Public Shared Sub members_add _ (ByVal rootid As Integer, ByVal username As String, ByVal password As String, ByVal email As String, ByVal sex As String, ByVal zip As String, ByVal tel As String, ByVal incorp As String, ByVal work As String, ByVal ip As String) Dim myconnection As New OleDbConnection (CommunityGlobals.ConnectionString) myconnection.Open () Dim mycommand As New OleDbCommand ( "insert into members ([rootid], [username], [ Password], [email], [sex], [zip], [tel], [incorp], [work], [ip], [updatetime]) value, @ rootid, @ username, @ password, @ email, @ Sex, @ zip, @ Tel, @ INCORP, @Work, @ @ @ @ @datetime Username) MyCommand.Parameters.add ("@ password", System.Web.Security.FormSauthentication.hashpasswordforstoringInconfigfile (Password, "MD5")) MyCommand.Parameters.Add ("@ email", email) MyCommand.Parameters.add ("@ sex", sex) mycommand.parameters.add ("@ zip", zip) mycommand.parameters.add ("@ tel", tel) mycommand.parameters.add ("@ incorp", Incorp) MyCommand.Parameters.add ("@ Work", Work) MyCommand.Parameters.add ("@ ip", ip) time mycommand.parameters.add ("@ updatetime", datetime.now) MyCommand.executenonQuery () MYCONNECTION.CLOSE () end sub '*********************************************************** ***************** The supplier's supplier '

*********************************************************** ********* Public Shared Sub members_add_2 _ (ByVal rootid As Integer, ByVal username As String, ByVal password As String, ByVal email As String, ByVal sex As String, ByVal zip As String, ByVal tel As String, ByVal incorp As String, ByVal work As String, ByVal ip As String, _ ByVal corpbrief As String, ByVal corpname As String, ByVal corpaddr As String, ByVal corpshape As String, ByVal corpscale As String, ByVal corpson As String, ByVal person As String , ByVal fax As String, ByVal legalpower As Integer) Dim myconnection As New OleDbConnection (CommunityGlobals.ConnectionString) myconnection.Open () Dim mycommand As New OleDbCommand (_ "insert into members ([rootid], [username], [password], [email], [sex], [zip], [tel], [incorp], [work], [ip], [updatetime], [corpbrief], [corpname], [Corpaddr], [Corpshape], [Corpscale ], [Corpson], [Person], [Fax], [LEGALPOWER]) VALUES (@ rootid, @ username, @ spread, @ email, @ sex, @ zip, @ tel, @ incorp, @ Work, @ @ @ @datetime, @ corpbrief, @ corpname, @ corpaddr, @ corpshape, @ corpscale, @ Corpson, @ Person, @ fax, @ legalpower) ", _myconnection" Basic mycommand.parameters.add ("@ rootid" , rootid) mycommand.Parameters.Add ( "@ username", username) mycommand.Parameters.Add ( "@ password", System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile (password, "md5")) mycommand.Parameters.Add ( "@Email", email) myCommand.Parameters.add ("@ sex", sex) mycommand.parameters.add ("@ zip", zip) mycomb.parameters.add ("@ tel"

, tel) MyCommand.Parameters.add ("@ incorp", incrorp) mycomb.Parameters.add ("@ Work", work) mycommand.parameters.add ("@ ip", ip) time mycommand.parameters.add ( "@UPDATETIME", DateTime.Now) 'basic mycommand.Parameters.Add ( "@ corpbrief", corpbrief) mycommand.Parameters.Add ( "@ corpname", corpname) mycommand.Parameters.Add ( "@ corpaddr", corpaddr ) Mycommand.Parameters.add ("@ Corpshape", Corpshape) mycommand.parameters.add ("@ Corpscale", Corpscale) mycomb.Parameters.add ("@ Corpson", Corpson) MyCommand.Parameters.Add ("@ person" , Person) MyCommand.Parameters.add ("@ fax", fax) 'permission mycommand.parameters.add ("@ legalpower", legalpower) myCommand.executenonQuery () MyConnection.Close () end sub' ****** *********************************************************** *** 'Product Address' supplier to the supplier to submit data' ****************************************************** ************************ Public Shared Sub Product_ADD _ (B yVal boardid As Integer, ByVal product_name As String, ByVal product_SHAPE As String, ByVal product_Specification As String, ByVal product_memory As String, ByVal product_money As Integer, ByVal addr As String, ByVal smallpic As String, ByVal pic As String, ByVal layer As Integer, ByVal sender As String, ByVal other As String, ByVal rootid As Integer, ByVal rootid2 As Integer, ByVal shape As String) Dim myconnection As New OleDbConnection (CommunityGlobals.ConnectionString) myconnection.Open () Dim mycommand As New OleDbCommand (_ "

insert into product ([boardid], [product_name], [product_SHAPE], [product_Specification], [product_memory], [product_money], [addr], [smallpic], [pic], [layer], [sender], [updatetime ], [other], [rootid], [rootid2], [shape]) values ​​(@ boardid, @ product_name, @ product_SHAPE, @ product_Specification, @ product_memory, @ product_money, @ addr, @ smallpic, @ pic, @ layer, @ sender, @ updatetime, @ other, @ rootid, @ rootid2, @ shape) ", _myconnection) 'basic mycommand.Parameters.Add (" @ boardid ", boardid) mycommand.Parameters.Add (" @ product_name ", product_name ) mycommand.Parameters.Add ( "@ product_SHAPE", product_SHAPE) mycommand.Parameters.Add ( "@ product_Specification", product_Specification) mycommand.Parameters.Add ( "@ product_memory", product_memory) mycommand.Parameters.Add ( "@ product_money" , PRODUCT_MONEY) MyCommand.Parameters.Add ("@ addr", addr) myCommand.Parameters.add ("@ smallpic", smallpic) myCommand.Parameters.Add ("@ pic", pic) myCommand.Parameters.add ("@ Layer, Layer) MyCommand.Parameters.add ("@ sender", mycommand.parameters.add ("@ updatetime", date.now.tostring) 'Basic MyCommand.Parameters.add ("@", Other ) MyCommand.Parameters.add ("@ rootid", rootid) mycommand.parameters.add ("@ rootid2", rootid2) mycomb.parameters.add ("@ shape", shape) mycomb.executenonquery () 'insert record

'Dim mysql2 As String' mysql2 = "update product set [rootid] = (select max (rootid) from product) 10 where [id] = max (id)" 'Dim mycommand2 As New OleDbCommand (mysql2, myconnection)' mycommand2 Ecutenonquery () update record mYConnection.close () end sub '***************************************************** ************************************************************************************************ ********************************************** Public Shared Sub Product_Add2_ (Byval Product_name As String, ByVal product_SHAPE As String, ByVal product_Specification As String, ByVal product_memory As String, ByVal pic As String) Dim myconnection As New OleDbConnection (CommunityGlobals.ConnectionString) myconnection.Open () Dim mycommand As New OleDbCommand (_ "insert into product ([product_name], [product_SHAPE], [product_Specification], [product_memory], [pic]) values ​​(@ product_name, @ product_SHAPE, @ product_Specification, @ product_memory, @ pic) ", _myconnection) 'basic mycommand.Parameters.Add (" @ product_ name ", product_name) mycommand.Parameters.Add (" @ product_SHAPE ", product_SHAPE) mycommand.Parameters.Add (" @ product_Specification ", product_Specification) mycommand.Parameters.Add (" @ product_memory ", product_memory) mycommand.Parameters.Add ( "@Pic", PIC)

MYCOMMAND.EXECUTENONQUERY () MyConnection.Close () end sub '*********************************************** ************************************************************************************************************************** ******************************************************* Public Shared Sub Product_Update _ ( ByVal rootid As Integer, ByVal rootid2 As Integer, ByVal shape As String, ByVal myid As String, ByVal boardid As Integer, ByVal product_name As String, ByVal product_SHAPE As String, ByVal product_Specification As String, ByVal product_memory As String, ByVal product_money As Integer, ByVal addr As String, ByVal smallpic As String, ByVal pic As String, ByVal other As String) Dim myconnection As New OleDbConnection (CommunityGlobals.ConnectionString) myconnection.Open () Dim mysql As String = "update product set [rootid] = @ rootid , [rootid2] = @ rootid2, [shape] = @ shape, [boardid] = @ boardid, [product_name] = @ product_name, [product_shape] = @ product_shape, [product_Specification] = @ roduct_Specification, [product_memory] = @ product _Memory, [Product_Money] = @ product_money, [addr] = @ addr, [smallpic] = @ smallpic, [@ @ @ @ @ @ {@ sender, [updatetime] = @ UpdateTime where [id] = "mysql = myid Dim mycommand As New OleDbCommand (mysql, myconnection) 'basic mycommand.Parameters.Add (" @ rootid ", rootid) mycommand.Parameters.Add (" @ rootid2 ", rootid2) mycommand .Parameters.add ("@ shape", shape) mycommand.parameters.add ("@ BoardID", BoardId) MyCommand.Parameters.add ("@ Product_name"

, Product_name) mycommand.Parameters.Add ( "@ product_SHAPE", product_SHAPE) mycommand.Parameters.Add ( "@ product_Specification", product_Specification) mycommand.Parameters.Add ( "@ product_memory", product_memory) mycommand.Parameters.Add ( "@ product_money ", product_money) mycommand.Parameters.Add (" @ addr ", addr) mycommand.Parameters.Add (" @ smallpic ", smallpic) mycommand.Parameters.Add (" @ pic ", pic) 'mycommand.Parameters.Add ("@layer", layer) myCommand.Parameters.add ("@", @ Sender ", System.Web.httpContext.current.Session (" UserName ")) Mycommand.Parameters.Add ("@ UpdateTime", Date.Now.toString)

mycommand.ExecuteNonQuery () myconnection.Close () End Sub Public Shared Sub product_update_test (ByVal myid As String, ByVal product_name As String) Dim myconnection As New OleDbConnection (CommunityGlobals.ConnectionString) myconnection.Open () Dim mysql As String = "update product set product_name = @ product_name where [id] = "mysql = myid Dim mycommand As New OleDbCommand (mysql, myconnection) mycommand.Parameters.Add (" @ product_name ", product_name) mycommand.ExecuteNonQuery () myconnection.Close () End Sub public Shared Sub subjects_update (ByVal id As String, ByVal rootid As Integer, ByVal subject As String) Dim myconnection As New OleDbConnection (CommunityGlobals.ConnectionString) myconnection.Open () Dim mysql As String = "update subjects set rootid = @ rootid, subject @ @ Subject where [id] = "& id Dim MyCommand as new oledbcommand (mysql, myconnection) myCommand.Parameters.Add (" @ rootid ", R ootid) mycommand.Parameters.Add ( "@ subject", subject) mycommand.ExecuteNonQuery () myconnection.Close () End Sub 'note: id is not being used, the purpose is compatible with subjects_update Public Shared Sub subjects_Add (ByVal id As String , ByVal rootid As Integer, ByVal subject As String) Dim myconnection As New OleDbConnection (CommunityGlobals.ConnectionString) myconnection.Open () Dim mysql As String = "insert into subjects ([rootid], [parentcolumn], [subject]) values ​​( @ rootid, @ ParentColumn, @ Subject) "DIM MyCommand as new oledbcommand (mysql, myconnection) myCommand.parameters.add ("

@Rootid ", rootid) mycomb.parameters.add (" @ ParentColumn "," Product Publishing ") MyCommand.Parameters.add (" @ Subject ", Subject) MyCommand.executenonQuery () MyConnection.Close () end sub '** *********************************************************** ******* 'Voting' available for submission data '****************************************** ************************ Public Shared Sub mycount_add (Byval Result As String) DIM MyConnection As New OledbConnection (CommunityGlobals.connectionstring) MyConnection.Open () DIM Mysql as string = "INSERT INTO Mycount ([Result], [UpdateTime], [IP]) Values ​​(@RESULT, @ UpdateTime, @ ip)" DIM MyCommand as new oledbcommand (mysql, myconnection) myCommand.Parameters.Add (" @Result ", result) mycommand.parameters.add (" @ UpdateTime ", now ()) MyCommand.Parameters.Add (" @ ip ", system.web.httpContext.current.Request.serverVariables (" local_addr ")) MyCommand .Executenonquery () myconnection.close () End Subend Class

转载请注明原文地址:https://www.9cbs.com/read-87206.html

New Post(0)