Protected Sub Upisi_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles Upisi.Click
Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
Dim mySqlConnection As New SqlConnection(connectionString)
Dim vrijeme2 As String
vrijeme2 = Convert.ToDateTime(GridView1.SelectedRow.Cells(5).Text)
If mySqlConnection.State = Data.ConnectionState.Open Then mySqlConnection.Close()
mySqlConnection.Open()
Dim strSqlInsert As String = "INSERT INTO Zahtjev_za_intervenciju (Prezime_ime, Opis_Lotus, Timestamp, Subject_Lotus, Atach_list, Lotus_Intranet) VALUES (@Prezime_ime, @Opis_Lotus, @Timestamp, @Subject_Lotus, @Atach_List, @Lotus_Intranet);"
Dim mySqlCommand As SqlCommand = New SqlCommand(strSqlInsert, mySqlConnection)
mySqlCommand.Parameters.AddWithValue("@Prezime_ime", GridView1.SelectedRow.Cells(3).Text)
mySqlCommand.Parameters.AddWithValue("@Subject_Lotus", GridView1.SelectedRow.Cells(6).Text)
mySqlCommand.Parameters.AddWithValue("@Opis_Lotus", txtBody.Text)
mySqlCommand.Parameters.AddWithValue("@Timestamp", Convert.ToDateTime(vrijeme2))
mySqlCommand.Parameters.AddWithValue("@Atach_List", txtAttach.Text)
mySqlCommand.Parameters.AddWithValue("@Lotus_Intranet", "L")
mySqlCommand.ExecuteNonQuery()
mySqlConnection.Close()
End Sub
|