Click here to Skip to main content
14,243,622 members
   

ASP.NET

 
AnswerRe: Ajax ToolKit File Upload CAN NOT upload AutoCAD files Pin
Richard Deeming21-May-19 0:39
mveRichard Deeming21-May-19 0:39 
Questionkeep web form drop down list from chagning Pin
dcof16-May-19 10:09
memberdcof16-May-19 10:09 
AnswerRe: keep web form drop down list from chagning Pin
Vinod Jangle28-May-19 10:41
memberVinod Jangle28-May-19 10:41 
QuestionRedirecting a user (vb.net) Pin
Member 876166712-May-19 23:22
memberMember 876166712-May-19 23:22 
AnswerRe: Redirecting a user (vb.net) Pin
Richard Deeming13-May-19 8:02
mveRichard Deeming13-May-19 8:02 
GeneralRe: Redirecting a user (vb.net) Pin
Member 87616679-Jun-19 23:56
memberMember 87616679-Jun-19 23:56 
QuestionEncountering error 401 1 2148074254 while accessing the webservice in NLB environment Pin
vinod koti7-May-19 3:22
membervinod koti7-May-19 3:22 
QuestionData Reader only producing one row of records. Any ideas why? Pin
samflex3-May-19 3:14
membersamflex3-May-19 3:14 
Greetings again.

As you can see from the code below, there are six input parameters and any one of those can be passed to display several rows of data from the database.

There is especially one called call_list_id.

When a value of call_list_id is passed, there are at least 15 records associated with it.

I can confirm this when I run it from SSMS.

However, I will pass same value through my app, only one record is displayed.

What is even more weird is that one record displays as soon as the page loads without even filtering with call_list_id value.

What am I doing wrong?

Many thanks in advance

Dim constr As String = ConfigurationManager.ConnectionStrings("stringst").ConnectionString
Dim conn As SqlConnection = New SqlConnection(constr)
Dim whereclause = ""
Dim Sql As String
Dim s As String = ""
conn.Open()
Dim cmd As New SqlCommand()
Sql = "SELECT phone_number, callerid, call_list_id, startttime,"
Sql += "connecttime, endtime, duration, fullduration,"
Sql += "camapign_id, queue_id, call_type_id, roll_id, cause_code, uuid, box_id, trunk_name, uuid, customer_id "
Sql += "FROM cti.qpcdr "
'Response.Write(Sql)
'Response.End()
whereclause = " uuid = @uuid Or call_list_id=@callerlist Or phone_number=@phone Or startttime=@start Or endtime=@end Or call_type_id=@calltype "
whereclause = whereclause & " ORDER BY endtime DESC"
'Response.Write(whereclause)
'Response.End()

'cmd.Connection = conn
cmd = New SqlCommand(Sql & "WHERE " & whereclause, conn)
cmd.Parameters.AddWithValue("@uuid", uuid.Text)
cmd.Parameters.AddWithValue("@callerlist", call_list_id.Text)
cmd.Parameters.AddWithValue("@phone", phone_number.Text)
cmd.Parameters.AddWithValue("@start", date_start.Text)
cmd.Parameters.AddWithValue("@end", date_end.Text)
cmd.Parameters.AddWithValue("@calltype", call_type.SelectedValue)
'conn.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader()
If dr.HasRows() Then
    'record exists'
    While dr.Read()
        lblphonenumber.Text = dr("phone_number").ToString()
        lblcallerid.Text = dr("callerid").ToString()
        lblcallerlist.Text = dr("call_list_id").ToString()
        lblstarttime.Text = dr("startttime").ToString()
        lblconnectime.Text = dr("connecttime").ToString()
        lblendtime.Text = dr("endtime").ToString()
        lblduration.Text = dr("duration").ToString()
        lblfullduration.Text = dr("fullduration").ToString()
        lblampaignname.Text = dr("camapign_id").ToString()
        lblqueuename.Text = dr("queue_id").ToString()
        lblcalltype.Text = dr("call_type_id").ToString()
        lblemployee.Text = dr("roll_id").ToString()
        lblisdn.Text = dr("cause_code").ToString()
        lbluuid.Text = dr("uuid").ToString()
        lbltelephony.Text = dr("box_id").ToString()
        lbltrunkname.Text = dr("trunk_name").ToString()
        lbluuid.Text = dr("uuid").ToString()
        lblrecording.Text = dr("customer_id").ToString()
    End While
End If
dr.Close()
conn.Close()

AnswerRe: Data Reader only producing one row of records. Any ideas why? Pin
Richard Deeming3-May-19 3:29
mveRichard Deeming3-May-19 3:29 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
samflex3-May-19 3:51
membersamflex3-May-19 3:51 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
Richard Deeming3-May-19 5:27
mveRichard Deeming3-May-19 5:27 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
samflex3-May-19 7:06
membersamflex3-May-19 7:06 
AnswerRe: Data Reader only producing one row of records. Any ideas why? Pin
jkirkerx3-May-19 9:18
professionaljkirkerx3-May-19 9:18 
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 
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 

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.