raelkun00's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
Active Members
Active Posts:
61 (0.09 per day)
Joined:
01-October 12
Profile Views:
688
Last Active:
User is offline Yesterday, 10:32 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   raelkun00 has not set their status

Posts I've Made

  1. In Topic: There are no usable controls in this group.

    Posted 29 Sep 2013

    My silverlight components are empty. There is nothing to select. Maybe that's the problem?
  2. In Topic: There are no usable controls in this group.

    Posted 29 Sep 2013

    There are already controls on other forms but yesterday it just happened after our thesis defense.
  3. In Topic: vshost32.exe has stopped working

    Posted 2 Sep 2013

    I solved my problem. It seems that the connection should not be close on my function. I just removed the code for closing the connection. Thanks Guys. ^_^
  4. In Topic: vshost32.exe has stopped working

    Posted 2 Sep 2013

    I am now getting this error
    Posted Image

    I upload a video on youtube what's happening.
    My link
  5. In Topic: Check if record already exist, if not Insert new record.

    Posted 25 Aug 2013

    I solved my problem. I used dataadapter and datatable instead of datareader. Thanks BTW.
    This is my code.
     Dim dr As New System.Windows.Forms.DataGridViewRow
            For Each dr In Me.dgvOrders.Rows
                Dim pno As String = dr.Cells(0).Value
                Dim price As String = dr.Cells(5).Value
                Dim qty As String = dr.Cells(6).Value
    
                Dim objCon As New dbConnect
                objCon.con.Open()
                Dim cmd As New OleDbCommand("Select * from SalesDetail where sales_id=@salesid and p_no=@pno", objCon.con)
                cmd.Parameters.AddWithValue("@salesid", txtSalesID.Text)
                cmd.Parameters.AddWithValue("@pno", pno)
                Dim da As New OleDbDataAdapter(cmd)
                Dim dt As New DataTable
                da.Fill(dt)
                If dt.Rows.Count = 0 Then
                    Dim cmd2 As New OleDbCommand("INSERT INTO SalesDetail values(@salesid,@pno,@price,@qty)", objCon.con)
                    cmd2.Parameters.AddWithValue("@salesid", txtSalesID.Text)
                    cmd2.Parameters.AddWithValue("@pno", pno)
                    cmd2.Parameters.AddWithValue("@price", price)
                    cmd2.Parameters.AddWithValue("@qty", qty)
                    cmd2.ExecuteNonQuery()
                Else
                    Dim cmd1 As New OleDbCommand("UPDATE SalesDetail set price=@price,qty=@qty where sales_id=@salesid and p_no=@pno", objCon.con)
                    cmd1.Parameters.AddWithValue("@price", price)
                    cmd1.Parameters.AddWithValue("@qty", qty)
                    cmd1.Parameters.AddWithValue("@salesid", txtSalesID.Text)
                    cmd1.Parameters.AddWithValue("@pno", pno)
                    cmd1.ExecuteNonQuery()
    
                End If
    
                objCon.con.Close()
            Next
    
    
    

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

raelkun00 hasn't added any friends yet.

Comments

raelkun00 has no profile comments yet. Why not say hello?