I created a Stored Procedure to save data, and wrote the comand in aspx here is some code so people can look at it, Maybe you could improve upon it. It works though
whathappened = "Data was Saved"
Dim conn As New SqlConnection(ConfigurationSettings.AppSettings("strDBConn"))
Try
conn.Open()
Dim cmd As New SqlCommand("saveorderkey", conn)
cmd.CommandType = CommandType.StoredProcedure
Dim cmd2 As New SqlCommand("log", conn)
cmd2.CommandType = CommandType.StoredProcedure
cmd2.Parameters.Add("@orderkey", txtorderkey.Text)
cmd2.Parameters.Add("@date", myDate)
cmd2.Parameters.Add("@time", myTime)
cmd2.Parameters.Add("@whathappened", whathappened)
cmd.Parameters.Add("@orderkey", txtorderkey.Text)
cmd.Parameters.Add("@building", txtbuilding2.Text)
cmd.Parameters.Add("@prefix", txtprefix.Text)
cmd.Parameters.Add("@cablepair", txtcablepair.Text)
cmd.Parameters.Add("@room", txtroom2.Text)
cmd.Parameters.Add("@panel", txtpanel.Text)
cmd.Parameters.Add("@ext", txtextension.Text)
cmd.Parameters.Add("@vgname", txtvgname.Text)
cmd.Parameters.Add("@port", txtport.Text)
cmd.Parameters.Add("@descr", txtdescription.Text)
cmd.Parameters.Add("@location", txtlocation.Text)
cmd.Parameters.Add("@jackdesi", txtjackdesi.Text)
cmd.Parameters.Add("@notes", txtnotes.Text)
cmd.Parameters.Add("@updated", txtupdated.Text)
cmd2.ExecuteNonQuery()
cmd.ExecuteNonQuery()
Catch ex As Exception
lblerr.Text = ex.Message
End Try
conn.Close()
End Sub
Stored procedure
CREATE PROCEDURE dbo.saveorderkey
@orderkey as int,
@building as varchar(25),
@room as varchar(25),
@panel as varchar(25),
@prefix as int,
@ext as varchar(4),
@cablepair as int,
@vgname as varchar(25),
@port as varchar(4),
@descr as varchar(50),
@location as varchar(25),
@jackdesi as varchar(25),
@notes as varchar(25),
@updated as varchar(25)
AS
insert into pairs(building, room, panel, prefix, ext, cablepair, vgname, port, descr, location, jackdesi, notes, updated)
Values (@building, @room, @panel, @prefix, @ext, @cablepair, @vgname, @port, @descr, @location, @jackdesi, @notes, @updated)
GO