กด like เพื่อติดตามข่าวสารดีๆ จาก cmprice.com VVVVVV
ลิงก์ผู้สนับสนุน
|
ลิงก์ผู้สนับสนุน
© เนื้อหาข่าว/กระทู้
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.ClickDim data As IDataObjectDim bmap As Image' Copy clipboard
SendMessage(hHwnd, WM_CAP_EDIT_COPY, 0, 0)
' clipboard convert bitmap
data = Clipboard.GetDataObject()
If data.GetDataPresent(GetType(System.Drawing.Bitmap)) Then
bmap =
picCapture.Image = bmap
ClosePreviewWindow()
btnSave.Enabled =
CType(data.GetData(GetType(System.Drawing.Bitmap)), Image)False
btnStop.Enabled =
False
btnStart.Enabled =
True
Dim Img As System.Drawing.Bitmap = New System.Drawing.Bitmap(picCapture.Width, picCapture.Height)Dim Graphics As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(Img)Dim Picname As String
Picname =
"test"
Graphics.DrawImage(picCapture.Image,
Img.Save(
photo = GetPhoto(
New System.Drawing.Rectangle(0, 0, picCapture.Width, picCapture.Height))"c:\\test.jpg")Dim photo As Byte()"c:\\test.jpg") ' Byte array
x.Open()
Try
' binary (byte array) ServiceIn
Dim sqlAdd As String
sqlAdd =
"INSERT INTO Login"
sqlAdd &=
"VALUES (@Li_id,@std_id,@std_name,@std_address,@std_level,@par_telephone,@par_name,@par_id,@photo,@R_id)"
.CommandText = sqlAdd
.CommandType = CommandType.Text
.Connection = x
.Parameters.Clear()
.Parameters.Add(
.Parameters.Add(
.Parameters.Add(
.Parameters.Add(
.Parameters.Add(
.Parameters.Add(
.Parameters.Add(
.Parameters.Add(
.Parameters.Add(
.Parameters.Add(
.ExecuteNonQuery()
Dim myCom As New SqlCommandWith myCom"@Li_id", SqlDbType.NChar).Value = TextBox6.Text.Trim()"@std_id", SqlDbType.NChar).Value = TextBox8.Text.Trim()"@std_name", SqlDbType.NVarChar).Value = TextBox2.Text.Trim()"@std_address", SqlDbType.NVarChar).Value = TextBox3.Text.Trim()"@std_level", SqlDbType.NVarChar).Value = TextBox1.Text.Trim()"@par_telephone", SqlDbType.NChar).Value = TextBox4.Text.Trim()"@par_name", SqlDbType.NVarChar).Value = TextBox5.Text.Trim()"@par_id", SqlDbType.NChar).Value = TextBox9.Text.Trim()"@photo", SqlDbType.Binary).Value = photo"@R_id", SqlDbType.NChar).Value = TextBox7.Text.Trim()End With
x.Close()
objDataAdapter1.Fill(objdataset1,
DataGridView1.DataSource = objdataset1
DataGridView1.DataMember =
Dim objDataAdapter1 As New SqlDataAdapter("select*from Login", x)Dim objdataset1 As DataSet = New DataSet"LogIn")"LogIn"
MessageBox.Show(
clearALLData()
MessageBox.Show(
"", "", MessageBoxButtons.OK, MessageBoxIcon.Information)Catch ex As Exception" :" & ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)End Try
End If
End Sub
ลิงก์ผู้สนับสนุน
|
ลิงก์ผู้สนับสนุน
|
|
|
|