I have to prepare a report in crystal report, showing the key, client, client name, credit amount and loan date fields. at the moment of executing what I already have, it throws me an error in the "fill of data" I assume that the query is wrong, I hope you can help me since I am not much of programming or things like that
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim con As SqlConnection = New SqlConnection("server=DESKTOP-SAHPQ10;Database=SistemadeVentas;UID=sa;Pwd=avilalopez12;")
Dim comando As SqlCommand = New SqlCommand("Select Clientes.id_cliente,nombrecliente,apellido_paterno,apellido_materno,fecha_credito,monto,pagado from Clientes", con)
Dim adaptador As SqlDataAdapter = New SqlDataAdapter
con.Open()
datos.Clear()
adaptador.SelectCommand = comando
adaptador.Fill(datos, "creditos")
Dim rpt As New CrystalReport1
rpt.Load()
rpt.SetDataSource(datos)
rpt.Refresh()
CrystalReportViewer1.ReportSource = rpt
rpt.Refresh()