You need to sign in to do that
Don't have an account?
Joan
use GridView in search
Hello
After I do the search as following:
binding.search("find {test}in ALL FIELDS returning solution(SolutionName, SolutionNote)")
How can I use GridView so that I can display limite records each page?
Thanks,
Now you can set the datasource of your grid to the dataset.
Dim dstAccounts As New DataSet,
I got error DataSet is not defined, any class I need to import?
Thanks,
any examples in vb.net?
Thanks,
Thanks for reply, but when I try this coding, I got error message: Array is a type and cannot be used as expression
Following is my original coding before I got your reply:
<asp:DataGrid id="MySolutions" AutoGenerateColumns="False" AllowPaging="true" AllowSorting="true"
Width="100%" DataKeyField="SolutionName" runat="server">
<HeaderStyle BackColor="#66CCFF" Font-Names="Arial" Font-Size="10" Font-Bold="True"/>
<ItemStyle BackColor="#FFFFFF" Font-Names="Arial" Font-Size="9"/>
<Columns>
<asp:TemplateColumn HeaderText="Solution Name">
<ItemTemplate>
<asp:Label ID="Label1" Text='<%# DataBinder.Eval(Container.DataItem, "SolutionName")%>' runat="server"/>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<Columns>
<asp:TemplateColumn HeaderText="Solution Note">
<ItemTemplate>
<asp:Label ID="Label1" Text='<%# DataBinder.Eval(Container.DataItem, "SolutionNote")%>' runat="server"/>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
codbehind:
Try
mySearchResult = sfdc.search("find {" & SolutionSearch.Text & "}in ALL FIELDS returning solution(SolutionName, SolutionNote, IsPublished, Related_To__c, Publish_to_public__c)")
Dim records() As SearchRecord = mySearchResult.searchRecords
Dim Solutions As System.Collections.ArrayList = New System.Collections.ArrayList
If Not mySearchResult.searchRecords Is Nothing Then
For i As Integer = 0 To records.Length - 1
Dim record As sObject = records(i).record
If record.GetType Is GetType(Solution) Then
Solutions.Add(record)
End If
Next
If (Solutions.Count > 0) Then
Dim myDataset As DataSet = CreateDataSet()
For i As Integer = 0 To Solutions.Count - 1
MySolutions.DataSource = mySearchResult.searchRecords
MySolutions.DataBind()
Next
Else
lblsolutions.Text = "No records found<hr>"
End If
Else
lblsolutions.Text = "No records found<hr>"
End If
Catch ex As Exception
Response.Write(ex.Message.ToString & "<hr>")
End Try
After run, I got error: DataBinding: 'sfdcSandbox.SearchRecord' does not contain a property with the name 'SolutionName'.
any idea? Thanks,
One important question, are you using the Partner WSDL or the Enterprise WSDL?
Hi dave,
Thank you so much for your quickly reply, we are using Enterprise WSDL, I'll try your coding and let you know if it works or not
Hi There,
I'm going to create windows appication instaed of web application using Microsoft Visual Studio 2005, I know after create windows application, I need to create exe file to execute it, but I don't know how to create exe file in MS VS 2005, anyone can tell me?
Thanks