Page 2 of 2 FirstFirst 12
Results 41 to 45 of 45

Thread: How to display the last inserted records in crystal report

  1. #41
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: How to display the last inserted records in crystal report

    Forget it... in your post #25 you showed that it's the same datetime for all inserted records
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  2. #42

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2010
    Posts
    965

    Re: How to display the last inserted records in crystal report

    Let me clarify myself for something. Will i ever have a problem as for as millisecond is concern? I mean that i've tried 7, 8 records but the millisecond doesn't change. But i mean that if the records are too many, so will millisecond be effected?

  3. #43
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: How to display the last inserted records in crystal report

    You are not dealing with milliseconds...

    Could you post the code where you are inserting the records
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  4. #44

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2010
    Posts
    965

    Re: How to display the last inserted records in crystal report

    This is my insert button code on my SaleInfo Form.
    Code:
     Try
    
                If dgvSales.Rows.Count <= 0 Then
                    MessageBox.Show("At Least One record must be available in Data Viewer", "SellingMS", MessageBoxButtons.OK)
                Else
    
    
                    Dim insSale As String = "insert into SaleInfo (Prod_ID, Sale_Prod_Qty, Sale_Prod_POO, Sale_Prod_POA, Sale_Date) values (@Prod_ID, @Sale_Prod_Qty, @Sale_Prod_POO, @Sale_Prod_POA, @Sale_Date)"
                    Dim cmdSql As New SqlCommand(insSale, cnSql)
                    cmdSql.CommandType = CommandType.Text
                    daSql.InsertCommand = cmdSql
    
                    cnSql.Open()
                    Dim i As Integer
                    For i = 0 To (dtSale.Rows.Count - 1)
    
    
                        cmdSql.Parameters.Clear()
    
                        With cmdSql
                            .Parameters.Add("@Prod_ID", SqlDbType.Int).Value = dtSale.Rows(i)("SaleProductID")
                            .Parameters.Add("@Sale_Prod_Qty", SqlDbType.Int).Value = dtSale.Rows(i)("SaleProductQty")
                            .Parameters.Add("@Sale_Prod_POO", SqlDbType.Int).Value = dtSale.Rows(i)("SaleProductUnitPrice")
                            .Parameters.Add("@Sale_Prod_POA", SqlDbType.Int).Value = dtSale.Rows(i)("SaleProductAllPrice")
                            .Parameters.Add("@Sale_Date", SqlDbType.DateTime).Value = dtSale.Rows(i)("DateTime")
                        End With
                        cmdSql.ExecuteNonQuery()
    
                    Next
                    MessageBox.Show(i & "  " & " records have been inserted successfully", "SellingMS", MessageBoxButtons.OK)
                    txtSaleID.Focus()
                    Call Clear(Me)
                    Call selSale()
                    Call ClearCombo(Me)
                    dtSale.Rows.Clear()
    
                    frmPracticeReport.Show()
    
                End If
    
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            Finally
                cnSql.Close()
            End Try

  5. #45

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2010
    Posts
    965

    Re: How to display the last inserted records in crystal report

    So, My project is completed. Do you know that how to attach the Crystal Report to Setup File.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width