Imports System.Data
+Imports System.Drawing
+Imports System.IO
Imports Microsoft.Win32
+
Public Class SignUp
Dim cmd As New OleDb.OleDbCommand
Dim da3 As New OleDb.OleDbDataAdapter
Dim dr2 As NEADataSet.UsersRow
Dim ID As Integer
Dim CardNum As Integer
+
CardNum = CInt(txtCardNum.Text)
Dim CVC As Integer
CVC = CInt(txtCVC.Text)
- dr = dt.NewRow()
+ dr = dt.NewUser_DetailsRow()
dr.Item("FirstName") = txtFirstName.Text
dr.Item("LastName") = txtLastName.Text
dr.Item("AddressLine1") = txtAddress.Text
dr.Item("Postcode") = txtPostcode.Text
dr.Item("Town") = txtTown.Text
-
-
-
-
+ If imgpath <> "" Then
+ Dim img As Image = Image.FromFile(imgpath)
+ Dim bArr As Byte() = imgToByteArray(img)
+ dr.Item("ProfilePic") = bArr
+ End If
dt.AddUser_DetailsRow(dr)
da.Update(dt)
-
MsgBox("Your data has been successfully added")
- da.Fill(dt)
+ da.Fill(dt)
Dim Q As String = "[FirstName] = '" & txtFirstName.Text & "'"
Dim result() As NEADataSet.User_DetailsRow = dt.Select(Q)
dr2.Item("Username") = txtUsername.Text
dr2.Item("Password") = txtPassword.Text
+
+
+
dt2.AddUsersRow(dr2)
da2.Update(dt2)
fileUri = New Uri(OFD.FileName)
ProfilePic.Source = New BitmapImage(fileUri)
+
OFD = Nothing
Catch ex As Exception
MsgBox(ex.Message.ToString())
End Try
End Sub
+ Private Function imgToByteArray(ByVal img As Image) As Byte()
+ Using mStream As New MemoryStream()
+ img.Save(mStream, Imaging.ImageFormat.Jpeg)
+ Return mStream.GetBuffer()
+ End Using
+ End Function
- ' Private Sub txtIGN_LostFocus(sender As Object, e As RoutedEventArgs) Handles txtIGN.LostFocus
- ' If txtIGN.Text <> "In Game Name" Then
- ' lblIGN.Content = txtIGN
- ' End If
- 'End Sub
End Class