Click here to Skip to main content
15,889,266 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Check duplicate before inserting in database Pin
Viral Upadhyay18-Feb-10 20:35
Viral Upadhyay18-Feb-10 20:35 
GeneralRe: Check duplicate before inserting in database Pin
Mogamboo_Khush_Hua18-Feb-10 21:17
Mogamboo_Khush_Hua18-Feb-10 21:17 
GeneralRe: Check duplicate before inserting in database Pin
Viral Upadhyay19-Feb-10 0:22
Viral Upadhyay19-Feb-10 0:22 
AnswerRe: Check duplicate before inserting in database Pin
Anurag Gandhi18-Feb-10 23:31
professionalAnurag Gandhi18-Feb-10 23:31 
Questionhow to pass parameter from the main report to subreport based on the primary using report viewer + asp.net with C# Pin
Victoriya Raj18-Feb-10 18:32
Victoriya Raj18-Feb-10 18:32 
Questioncrystal report Pin
shanthi jothi18-Feb-10 18:20
shanthi jothi18-Feb-10 18:20 
AnswerRe: crystal report Pin
Arnalyn19-Feb-10 0:31
Arnalyn19-Feb-10 0:31 
QuestionDataSourceSelectArguments Cannot Be Converted to Integer Pin
Sid Childers18-Feb-10 18:18
Sid Childers18-Feb-10 18:18 
Hello All,

I am following the SearchableGrdview article posted on this site and am trying to implement it in ASP.net VB. To that end, I've taken the source file posted on the article and ran it through a C# to VB converter and pasted the resulting VB code in my application where applicable.

I have an entitydatasource that I'm trying to attach to the DataView in the article's code. Here' the pertinent snippet of the codebehind:
Private Sub BindData()
        'hfSearchText has the search string returned from the grid
        If hfSearchText.Value <> "" Then
            EntityDataSource1.Select += " where " & hfSearchText.Value
        End If
        Dim dv As DataView = DirectCast(EntityDataSource1.[Select](New DataSourceSelectArguments()), DataView)
        'hfSort has the sort string returned from the grid
        If hfSort.Value <> "" Then
            dv.Sort = hfSort.Value
        End If

        MySearch.DataSource = dv

        Try
            MySearch.DataBind()
        Catch ex As Exception
            'If databinding threw execept bc current
            'page index is > than available page index
            MySearch.PageIndex = 0
            MySearch.DataBind()
        Finally
            'Select the first row returned
            If MySearch.Rows.Count > 0 Then
                MySearch.SelectedIndex = 0
            End If
        End Try

    End Sub


I'm a relative newbie to data access and don't fully understand why a DataView is being implemented. Can someone enlighten me?

When I check my error listing, I see the following:
Value of type 'System.Web.UI.DataSourceSelectArguments' cannot be converted to 'Integer'.

How do I correct this? Is this issue being caused by the conversion from C# to VB? Or, is there something particular to the use of an entity datasource that must be done differently for the code in the article to work?

Thanks so much for your help an guidance!
QuestionRetrieving checkbox value from db Pin
test-0918-Feb-10 17:55
test-0918-Feb-10 17:55 
AnswerRe: Retrieving checkbox value from db Pin
Dinesh Mani18-Feb-10 18:20
Dinesh Mani18-Feb-10 18:20 
GeneralRe: Retrieving checkbox value from db Pin
test-0918-Feb-10 18:33
test-0918-Feb-10 18:33 
GeneralRe: Retrieving checkbox value from db Pin
Dinesh Mani18-Feb-10 18:36
Dinesh Mani18-Feb-10 18:36 
GeneralRe: Retrieving checkbox value from db Pin
test-0918-Feb-10 18:41
test-0918-Feb-10 18:41 
GeneralRe: Retrieving checkbox value from db Pin
Dinesh Mani18-Feb-10 19:13
Dinesh Mani18-Feb-10 19:13 
GeneralRe: Retrieving checkbox value from db Pin
test-0918-Feb-10 19:24
test-0918-Feb-10 19:24 
GeneralRe: Retrieving checkbox value from db Pin
Dinesh Mani18-Feb-10 19:29
Dinesh Mani18-Feb-10 19:29 
GeneralRe: Retrieving checkbox value from db Pin
test-0918-Feb-10 19:35
test-0918-Feb-10 19:35 
GeneralRe: Retrieving checkbox value from db Pin
Dinesh Mani18-Feb-10 19:43
Dinesh Mani18-Feb-10 19:43 
GeneralRe: Retrieving checkbox value from db Pin
test-0918-Feb-10 19:55
test-0918-Feb-10 19:55 
GeneralRe: Retrieving checkbox value from db Pin
Dinesh Mani18-Feb-10 20:08
Dinesh Mani18-Feb-10 20:08 
GeneralRe: Retrieving checkbox value from db Pin
Ravindra Nidhonkar18-Feb-10 22:32
Ravindra Nidhonkar18-Feb-10 22:32 
AnswerRe: Retrieving checkbox value from db Pin
Anurag Gandhi18-Feb-10 18:38
professionalAnurag Gandhi18-Feb-10 18:38 
GeneralRe: Retrieving checkbox value from db Pin
test-0918-Feb-10 18:46
test-0918-Feb-10 18:46 
AnswerRe: Retrieving checkbox value from db Pin
Brij18-Feb-10 18:48
mentorBrij18-Feb-10 18:48 
GeneralRe: Retrieving checkbox value from db Pin
test-0918-Feb-10 18:56
test-0918-Feb-10 18:56 

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.