-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: smart_siva
Message 12 in Discussion


hI KIRAN.,


   First u try with hot coded value like ur dropdownlist value + exp value 
with ur query directly.
then let us see..

for ex,


dv.RowFilter = "(emp_skill1 LIKE  'kumar*') AND (emp_experience_years >='1' 
)"



    I just tried with following samples but it works fine like ur scenario.



Let u look on this...

       Dim myconn As SqlConnection
        myconn = GetConnection()
        Dim myds As New DataSet
        Dim myada As New SqlDataAdapter("select * from tEST", myconn)
        myada.Fill(myds)



        Dim mydv As DataView = myds.Tables(0).DefaultView
        mydv.RowFilter = "name like 't*' AND ID=1"


My DB Datas.

id      name
1               tt
2               ss
2               ss

(3 row(s) affected)


    It returns 1 row

Pls try

with regards
siva.s


>From: "DotNetHunk" <[EMAIL PROTECTED]>
>Reply-To: "BDOTNET" <[email protected]>
>To: "BDOTNET" <[email protected]>
>Subject: Re: Dataview rowfilter condition(urgent)
>Date: Sat, 1 Oct 2005 04:59:15 -0700
>
>
>
>
>
>
>
>
>
>
>
>
>     New Message on BDOTNET
>
>
>
>
>
>
>
>       Dataview rowfilter condition(urgent)
>
>
>
>
>       Reply
>
>
>
>                 
>
>                   Reply to Sender
>                     Recommend
>
>                   Message 9 in Discussion
>
>
>
>
>
>
>
>               From:
>               DotNetHunk
>
>
>
>
>               hmm,jus' tried using the following code yaar.still it 
>says,no records found.
>yah i used ::DataView.RowFilter="(emp_skill1 LIKE " ' + emp_skill1 + "%" + 
>' ") AND (emp_experience_years >=' + exp + ' )"
>
>pl check
>
>
>
>Sub BindTheData()
>             Dim objConn As SqlConnection
>             Dim objDrop1, objDrop2 As SqlCommand
>             objConn = New SqlConnection("data source=localhost;user 
>id=sa;password=;initial catalog=onlinejobapp")
>             Try
>                 objConn.Open()
>                 Dim strDrop1, strDrop2 As String
>                 Dim da As SqlDataAdapter = New SqlDataAdapter("SELECT * 
>from employerview", objConn)
>                 da.Fill(ds, "employerview")
>                 ds.Tables(0).TableName = "employerview"
>                 dv = New DataView(ds.Tables(0))
>                 dv.RowStateFilter = DataViewRowState.CurrentRows
>                 DataGrid1.DataSource = dv
>                 DataGrid1.DataBind()
>                 strDrop1 = "select * from skill where skill<>''"
>                 objDrop1 = New SqlCommand(strDrop1, objConn)
>                 objDR1 = objDrop1.ExecuteReader
>                 DropDownList1.DataSource = objDR1
>                 DropDownList1.DataBind()
>                 DropDownList1.Items.Insert(0, New ListItem("-- Choose a 
>Skill --"))
>                 objDR1.Close()
>                 strDrop2 = "select distinct emp_experience_years from 
>emp_summary "
>                 objDrop2 = New SqlCommand(strDrop2, objConn)
>                 objDR2 = objDrop2.ExecuteReader
>                 DropDownList2.DataSource = objDR2
>                 DropDownList2.DataBind()
>                 DropDownList2.Items.Insert(0, New ListItem("-- Choose 
>Experience --"))
>                 objDR2.Close()
>             Catch
>             Finally
>                 If objConn.State = ConnectionState.Open Then
>                     objConn.Close()
>                     objConn.Dispose()
>                 End If
>             End Try
>         End Sub
>
>         Sub SearchIT(ByVal sender As System.Object, ByVal e As 
>System.EventArgs)
>             'DataView1.RowFilter = "emp_experience_years=" & 
>CInt(DropDownList1.SelectedItem.Value)
>             Dim skill As String = DropDownList1.SelectedItem.Value
>             Dim exp As Integer = CInt(DropDownList2.SelectedItem.Value)
>             Dim result As String
>             dv.RowFilter = "(emp_skill1 LIKE  '" + skill + "%" + "') AND 
>(emp_experience_years >=' + exp + ' )"
>             'dv.RowFilter = result '"emp_skill1 like 'skill'" 'result
>             'dv.RowFilter = "emp_skill1 Like '" + skill + " '   'AND 
>"emp_experience_years >= ' "+ exp + ''
>             lblDV.Text = "one::" & DropDownList1.SelectedItem.Value & 
>"two:::" & DropDownList2.SelectedItem.Value
>             'lblDV.Text += dv.Count
>             If dv.Count > 0 Then
>                 DataGrid1.DataBind()
>                 lblMsg.Text = dv.Count & " row(s) found...."
>                 DataGrid1.Visible = True
>             Else
>
>                 lblMsg.Text = "No records found.."
>                 DataGrid1.Visible = False
>             End If
>
>         End Sub
>
>
>
>
>
>
>     View other groups in this category.
>
>
>
>
>
>
>
>
>
>
>
>
>
>Also on MSN:
>Start Chatting | Listen to Music | House & Home | Try Online Dating | Daily 
>Horoscopes
>
>
>
>
>
>
>
>
>
>
>                   To stop getting this e-mail, or change how often it 
>arrives, go to your E-mail Settings.
>
>
>                                 Need help? If you've forgotten your password, 
> please go 
>to Passport Member Services.
>
>                                 For other questions or feedback, go to our 
> Contact Us 
>page.
>
>
>                                 If you do not want to receive future e-mail 
> from this 
>MSN group, or if you received this message by mistake, please click the 
>"Remove" link below. On the pre-addressed e-mail message that opens, simply 
>click "Send". Your e-mail address will be deleted from this group's mailing 
>list.
>
>
>             Remove my e-mail address from BDOTNET.
>
>
>
>
>
>
>

_________________________________________________________________
Calling all teachers! Be part of the MS Innovative Teachers awards. 
http://70.86.46.181/itla/index.html Register now!



-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to