Click here to Skip to main content
14,241,673 members
   

ASP.NET

 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
samflex3-May-19 9:51
membersamflex3-May-19 9:51 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
jkirkerx3-May-19 10:16
professionaljkirkerx3-May-19 10:16 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
jkirkerx3-May-19 10:34
professionaljkirkerx3-May-19 10:34 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
samflex10-May-19 4:39
membersamflex10-May-19 4:39 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
jkirkerx10-May-19 8:22
professionaljkirkerx10-May-19 8:22 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
samflex10-May-19 10:31
membersamflex10-May-19 10:31 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
jkirkerx12-May-19 13:15
professionaljkirkerx12-May-19 13:15 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
samflex16-May-19 14:39
membersamflex16-May-19 14:39 
Greetings again.

I am still working on this issue but I have made good progress.

Right now, I am using GridView control which seems to be displaying more than one, several rows as a matter of fact.

My issue now is with embedded query.

There are 6 input parameters and a user can search with one or more at same time.

The query is not results based on input parameter.

For instance, if I select an item from the call_type dropdownList, I expect results based on the selected item from the dropdownList.

The query is not doing that. It is displaying ALL the records.

Same is the case with the rest of the parameters; the filtering is not working and I believe it has to do with the WHERE clauses in the query.

Can you please, please help?

Protected Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click
      Me.SearchCustomers()
  End Sub
  Private Sub SearchCustomers()
      Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString

      Using con As New SqlConnection(constr)

          Using cmd As New SqlCommand()
              Dim sql As String = "Select top 100 phone_number, callerid, call_list_id, startttime, "
              sql += "connecttime, endtime, duration, fullduration,ca.campName,"
              sql += "camapign_id, q.queueName, c.name as call_type, roll_id, (e.first_name +'  '+ e.last_name) employee, i.name as cause_code, uuid, box_id, trunk_name, uuid, customer_id "
              sql += "From cti.qpcdr qp inner join cti.call_types c on qp.call_type_id = c.id "
              sql += "inner join cti.queues q on qp.queue_id = q.queueId "
              sql += "inner join cti.campaign ca on qp.camapign_id = ca.campaign_id "
              sql += "inner join cti.isdn_cause_code i On qp.cause_code = i.cause_code "
              sql += "inner join cti.employee e on qp.employee_id = e.employee_id "

              If Not String.IsNullOrEmpty(suuid.Text.Trim()) Or Not String.IsNullOrEmpty(caller_list_id.Text.Trim()) Or Not String.IsNullOrEmpty(phone.Text.Trim()) Or Not String.IsNullOrEmpty(start.Text.Trim()) Or Not String.IsNullOrEmpty(endd.Text.Trim()) Or Not String.IsNullOrEmpty(calltype.Text.Trim()) Then

                  sql += " WHERE 1 = 1 AND qp.uuid LIKE '%' + @uuid + '%'"
                  sql += " OR qp.call_list_id LIKE '%' + @callerlist + '%'"
                  sql += " OR qp.phone_number LIKE '%' + @phone + '%'"
                  sql += " OR qp.startttime LIKE '%' + @start + '%'"
                  sql += " OR qp.endtime LIKE '%' + @Endd + '%'"
                  sql += " OR c.id LIKE '%' + @calltype + '%'"

                  cmd.Parameters.AddWithValue("@uuid", suuid.Text)
                  cmd.Parameters.AddWithValue("@callerlist", caller_list_id.Text)
                  cmd.Parameters.AddWithValue("@phone", phonenumber.Text)
                  cmd.Parameters.AddWithValue("@start", date_start.Text)
                  cmd.Parameters.AddWithValue("@Endd", date_end.Text)
                  cmd.Parameters.AddWithValue("@calltype", call_type.SelectedValue)

              End If
              cmd.CommandText = sql
              cmd.Connection = con
              Using sda As New SqlDataAdapter(cmd)
                  Dim dt As New DataTable()
                  sda.Fill(dt)
                  gvCustomers.DataSource = dt
                  gvCustomers.DataBind()

              End Using
          End Using
      End Using
  End Sub

Questionodata Pin
Member 140736591-May-19 2:33
memberMember 140736591-May-19 2:33 
AnswerRe: odata Pin
jkirkerx3-May-19 9:01
professionaljkirkerx3-May-19 9:01 
QuestionSOAP and using a Class containing two sub classes with same name problem Pin
Martin Stevens26-Apr-19 17:18
memberMartin Stevens26-Apr-19 17:18 
AnswerRe: SOAP and using a Class containing two sub classes with same name problem Pin
jkirkerx3-May-19 8:38
professionaljkirkerx3-May-19 8:38 
GeneralRe: SOAP and using a Class containing two sub classes with same name problem Pin
Martin Stevens10-May-19 20:03
memberMartin Stevens10-May-19 20:03 
GeneralRe: SOAP and using a Class containing two sub classes with same name problem Pin
jkirkerx12-May-19 13:03
professionaljkirkerx12-May-19 13:03 
Questionprint sql data from vb Pin
Member 1433060825-Apr-19 1:17
memberMember 1433060825-Apr-19 1:17 
AnswerRe: print sql data from vb Pin
Afzaal Ahmad Zeeshan25-Apr-19 1:36
mveAfzaal Ahmad Zeeshan25-Apr-19 1:36 
QuestionSharing API's between multiple sites in IIS 8.5 Pin
Fred283424-Apr-19 21:39
memberFred283424-Apr-19 21:39 
AnswerRe: Sharing API's between multiple sites in IIS 8.5 Pin
Richard Deeming25-Apr-19 1:17
mveRichard Deeming25-Apr-19 1:17 
GeneralRe: Sharing API's between multiple sites in IIS 8.5 Pin
Fred283425-Apr-19 1:47
memberFred283425-Apr-19 1:47 
QuestionSo I finally got my Angular wrapped in .Net Core 2.2 app working in a Docker Container on a production server. Pin
jkirkerx16-Apr-19 11:14
professionaljkirkerx16-Apr-19 11:14 
SuggestionRe: So I finally got my Angular wrapped in .Net Core 2.2 app working in a Docker Container on a production server. Pin
Richard MacCutchan20-Apr-19 22:16
protectorRichard MacCutchan20-Apr-19 22:16 
GeneralRe: So I finally got my Angular wrapped in .Net Core 2.2 app working in a Docker Container on a production server. Pin
jkirkerx21-Apr-19 8:17
professionaljkirkerx21-Apr-19 8:17 
Questionwithout using session and querty string value pass in another form Pin
UDTWS14-Apr-19 23:39
memberUDTWS14-Apr-19 23:39 
AnswerRe: without using session and querty string value pass in another form Pin
Vinod Jangle15-Apr-19 7:44
memberVinod Jangle15-Apr-19 7:44 
QuestionExpiry date and Update Expiry Date Pin
Member 1370260513-Apr-19 1:49
memberMember 1370260513-Apr-19 1:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.