<
WebMethod
()>
Public
Function
AddMemCard(
ByVal
ds
As
DataSet
)
As
String
Dim
con
As
New
SqlConnection
con.ConnectionString =
ConfigurationManager
.ConnectionStrings(
"wingsbook"
).ToString()
Dim
cmd
As
New
SqlCommand
Dim
da
As
New
SqlDataAdapter
Try
con.Open()
cmd.Connection = con
cmd.CommandText =
"Insert into WBMemCard(MemCardId,MemCardMoney,MemCardBuyMan,MemCardRegisterId,MemCardName,"
& _
"MemCardPhone,MemCardMobile,MemCardMail,MemCardAdress,MemCardSTime,MemCardSNname) values("
& _
"@MemCardId,@MemCardMoney,@MemCardBuyMan,@MemCardRegisterId,@MemCardName,"
& _
"@MemCardPhone,@MemCardMobile,@MemCardMail,@MemCardAdress,getdate(),@MemCardSNname)"
da.InsertCommand = cmd
cmd.Parameters.Add(
New
SqlParameter
(
"@MemCardId"
,
SqlDbType
.NVarChar, 50))
cmd.Parameters.Add(
New
SqlParameter
(
"@MemCardMoney"
,
SqlDbType
.Decimal))
cmd.Parameters.Add(
New
SqlParameter
(
"@MemCardBuyMan"
,
SqlDbType
.NVarChar, 50))
cmd.Parameters.Add(
New
SqlParameter
(
"@MemCardRegisterId"
,
SqlDbType
.Int))
cmd.Parameters.Add(
New
SqlParameter
(
"@MemCardName"
,
SqlDbType
.NVarChar, 50))
cmd.Parameters.Add(
New
SqlParameter
(
"@MemCardPhone"
,
SqlDbType
.NVarChar, 20))
cmd.Parameters.Add(
New
SqlParameter
(
"@MemCardMobile"
,
SqlDbType
.NVarChar, 20))
cmd.Parameters.Add(
New
SqlParameter
(
"@MemCardMail"
,
SqlDbType
.NVarChar, 100))
cmd.Parameters.Add(
New
SqlParameter
(
"@MemCardAdress"
,
SqlDbType
.NVarChar, 100))
cmd.Parameters.Add(
New
SqlParameter
(
"@MemCardSNname"
,
SqlDbType
.NVarChar, 50))
cmd.Parameters(0).SourceColumn =
"MemCardId"
cmd.Parameters(0).SourceVersion =
DataRowVersion
.Original
cmd.Parameters(1).SourceColumn =
"MemCardMoney"
cmd.Parameters(1).SourceVersion =
DataRowVersion
.Original
cmd.Parameters(2).SourceColumn =
"MemCardBuyMan"
cmd.Parameters(2).SourceVersion =
DataRowVersion
.Original
cmd.Parameters(3).SourceColumn =
"MemCardRegisterId"
cmd.Parameters(3).SourceVersion =
DataRowVersion
.Original
cmd.Parameters(4).SourceColumn =
"MemCardName"
cmd.Parameters(4).SourceVersion =
DataRowVersion
.Original
cmd.Parameters(5).SourceColumn =
"MemCardPhone"
cmd.Parameters(5).SourceVersion =
DataRowVersion
.Original
cmd.Parameters(6).SourceColumn =
"MemCardMobile"
cmd.Parameters(6).SourceVersion =
DataRowVersion
.Original
cmd.Parameters(7).SourceColumn =
"MemCardMail"
cmd.Parameters(7).SourceVersion =
DataRowVersion
.Original
cmd.Parameters(8).SourceColumn =
"MemCardAdress"
cmd.Parameters(8).SourceVersion =
DataRowVersion
.Original
cmd.Parameters(9).SourceColumn =
"MemCardSNname"
cmd.Parameters(9).SourceVersion =
DataRowVersion
.Original
da.Update(ds,
"MemCard"
)
ds.Dispose()
cmd.Dispose()
con.Close()
con.Dispose()
Return
"OK"
Catch
ex
As
Exception
Return
ex.Message
End
Try
End
Function