dcsimg
Results 1 to 2 of 2

Thread: [resolved] vs 2017

  1. #1

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,009

    Resolved [resolved] vs 2017

    what is missing in the code?
    Code:
                Dim ds As New DataSet
                Dim SQL As String = "Select Count(Payments.ID) As CountOfID ,Payments.CreditCardName,
                 Sum(Payments.Amount) As SumOfAmount
                 From Payments Where PaymentMethod=@PaymentMethod
                 AND DatePayRishum >=@DatePayRishum
                 AND DatePayRishum <= @DatePayRishum1 
                 Group By Payments.CreditCardName"
                Using CS As New SqlCommand(SQL, Cn)
                    Cn.Open()
                    CS.Parameters.AddWithValue("@PaymentMethod", "creditcard")
                    CS.Parameters.AddWithValue("@DatePayRishum", Format(DtStart.Value, TxxtStartDate))
                    CS.Parameters.AddWithValue("@DatePayRishum1", Format(DtEnd.Value, TxxtEndDate))
                    CS.ExecuteNonQuery()
                End Using
    
                Dim Cmd As New SqlDataAdapter(SQL, Cn)
                Cmd.Fill(ds, "Payments")
                Cn.Close()
                Dim objRpt As New CreditCardReport
                objRpt.SetDataSource(ds.Tables(0, "Payments"))
                objRpt.PrintToPrinter(0, True, 0, 0)
                objRpt.Dispose(
    tnx for any help
    salsa

  2. #2

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,009

    Re: VS 2017 getting error must declare the scalar variable after i declared it alread

    i fix it!!
    Last edited by salsa31; Aug 5th, 2019 at 11:16 AM.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width