|
I am using VB.Net windows form application developed in Visual Studio 2010, using web services to connecting to a SharePoint 2007 to retrieve custom list data. I can retrieve all records from the SharePoint custom list but when I try to filter out records and fields using the CAML fragments for the query and viewFields objects listed below, it does not filter either. I have tried many different variations (using “ows_” field names and without) to get a different query result but with no luck. It gets very strange when I use the viewFields object, it filters out the data listed in the viewFields object but leaves all the unwanted fields. No error messages are returned. Each and every time, the results set return all the records and fields in the list up to the RowLimit property as if the query and viewFields objects were not considered in the query. I have attached the function below for review. I can use any assistance to help resolve my dilemma. Thank you in advance for your assistance…
Private Function GetContractMainDataSet(ByVal cInConfiguratorName As String) As String
clsFunctions.DisplayStatusMessage("Retrieving Records, please wait...", stMessage)
Try
Dim ds As New DataSet
Dim cGUID_List As String = clsSP.cGUID_List_Configurator_Inventory_Log
Dim cGUID_View As String = "{085BAED5-3F10-4885-A99F-E6A5FEB1881A}"
Dim xmlDoc As XmlDocument = New XmlDocument
Dim query As System.Xml.XmlElement = xmlDoc.CreateElement("Query")
Dim viewFields As System.Xml.XmlElement = xmlDoc.CreateElement("ViewFields")
Dim queryOptions As System.Xml.XmlElement = xmlDoc.CreateElement("QueryOptions")
query.InnerXml = "<Query><OrderBy><FieldRef Name='Assigned Configurator' /></OrderBy>" & _
"<Where><Eq><FieldRef Name=""ows_Assigned Configurator"" />" & _
"<Value Type=""Text"">" & cInConfiguratorName & "</Value></Eq></Where></Query>"
viewFields.InnerXml = _
"<FieldRef Name='Title' />" & "<FieldRef Name='ows_Column3' />" & _
"<FieldRef Name='ows_Column4' />" & "<FieldRef Name='ows_Column5' />" & _
"<FieldRef Name='ows_Config_User' />" & "<FieldRef Name='ows_Smoke_User' />" & _
"<FieldRef Name='ows_Super_User' />" & "<FieldRef Name='ows_ID' />)")
queryOptions.InnerXml = "<queryoptions><IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns>" & _
"<DateInUtc>TRUE</DateInUtc></queryoptions>"
Dim cRowLimit As String = "90"
Dim cWebID As String = ""
Dim objCredentials As New NetworkCredential(clsSP.cUSID, clsSP.cPWID, "CS")
Dim SPList As New WS_WGK_List.Lists
With SPList
.Credentials = objCredentials
.Url = clsSP.cURL_Contract_List
Dim nodeSP As XmlNode = .GetListItems(clsSP.cGUID_List_Configurator_Inventory_Log, _
cGUID_View, query, viewFields, cRowLimit, queryOptions, cWebID)
If Not nodeSP Is Nothing And nodeSP.InnerXml.Length > 0 Then
Dim reader As XmlTextReader = New XmlTextReader(nodeSP.OuterXml, XmlNodeType.Element, Nothing)
ds.ReadXml(reader)
Else
End If
End With
Dim nCnt As Integer = ds.Tables(1).Rows.Count
If nCnt > 0 Then
With dgvContracts
.DataSource = ds
.DataMember = ds.Tables(1).TableName
.Refresh()
End With
clsFunctions.DisplayStatusMessage("Ready...", stMessage)
Else
clsFunctions.DisplayStatusMessage("No Status Records Found...", stMessage)
tmrMain.Interval = 5000
tmrMain.Enabled = True
End If
Return Nothing
Catch ex1 As System.Web.Services.Protocols.SoapException
MsgBox("ERROR #1: " & ex1.Message, MsgBoxStyle.Critical, "SharePoint Data Error")
Catch ex2 As Exception
MsgBox("ERROR #2: " & ex2.Message, MsgBoxStyle.Critical, "Data Retrieval Error")
End Try
End Function
|
|
|
|
|
Hi,
I am going through this VB Code which displays list of Printers in a Combobox using VB.Global Printers.
Now we are facing a problem in Citrix environment, where the HKCU\Software\Microsoft\Windows NT\CurrentVersion\Devices is getting messed up due to know issues (Citrix / Windows 2008). Now one could fix the problem if VB.Global Printers were to list printers listed in HKCU\Printers instead of the Key mentioned above.
Does anyone know how to make VB.Global Printers to point to a different key?
Thanks in advance.
S
|
|
|
|
|
Shyvmir wrote: using VB.Global Printers.
The one from the VB Powerpack[^]? Does the InstalledPrinters method on the PrinterSettings[^]-class have the same problem?
Bastard Programmer from Hell
|
|
|
|
|
Problem solved for now!
I tried reading the printers list using WMI scripting object instead of using VB6 Printers. This solved the problem.
|
|
|
|
|
Hello !
i'm working on a project with entity framework.
i have a form with several textbox , and i want to create a query depending on values on these textboxs.
The code is :
dim query= From t in context.customs where t.ndi=Me.TextBox1.Text
Select t
But this code doesn't work , and i get an error.If i change my code like :
dim x=Me.Textbox1.Text
dim query= From t in context.customs where t.ndi=x
Select t
everything is OK. But is possible to include on query directly the value of textbox like my first code ?
thank you.
|
|
|
|
|
alejx wrote: But this code doesn't work , and i get an error.
Perhaps you could include the message of the error in your post? It might help in determining what's wrong. I'm guessing that it has to do with an implicit conversion.
Why is your <a href="http://msdn.microsoft.com/en-US/library/zcd4xwzs%28v=VS.80%29.aspx">option strict</a>[<a href="http://msdn.microsoft.com/en-US/library/zcd4xwzs%28v=VS.80%29.aspx" target="_blank" title="New Window">^</a>] off?
Bastard Programmer from Hell
|
|
|
|
|
LINQ to Entities does not recognize the method 'System.Object CompareObjectEqual(System.Object, System.Object, Boolean)' method, and this method cannot be translated into a store expression.
|
|
|
|
|
Does the query below work? (I'm not at a compiler, can't test now)
dim query= From t in context.customs where CStr(t.ndi)=Me.TextBox1.Text
Select t
Bastard Programmer from Hell
|
|
|
|
|
doesn't work.The same error message.
|
|
|
|
|
..because the compiler can't "guess" what the correct type is, and hence doesn't know what methods can or cannot be called. I suggest you strong-type your variables and put the option strict back to "on".
Bastard Programmer from Hell
|
|
|
|
|
thx you so much to ALL of you who gaved me advices _hope you will always in GOD blesses___amiiiinnnnnn
|
|
|
|
|
i want to learn and know much about visual basic_especially VB coding and source code_any one can teach me and give me the software and source code ( special code )??? pleaseee...i will thx fully if all of your kindes_ thx u so much
|
|
|
|
|
I'd suggest you start on MSDN[^]
Bastard Programmer from Hell
|
|
|
|
|
hmmm teacher_may ask you?? what is MSDN ???
|
|
|
|
|
princeza aurora nada wrote: hmmm teacher_may ask you?? what is MSDN ???
How about you click on the link and try to find out, hmm??
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
It's easy.
The steps: -
1. Find ideas and objectives of the software.
2. And try to find the source code via google or any other server.
(This is a suggestion only. )
|
|
|
|
|
i'vent the software yet_:(_can you share it to me pleaseee_:(_i will thx fully for your kindess_
|
|
|
|
|
If you are talking about VB6 then drop that idea, Start with VB.NET.
Agree with Eddy, MSDN is best to start.
Here in CP you can find many articles in VB.NET, see those VB.NET articles @ Codeproject[^]
|
|
|
|
|
thx you for your great advises and support _thx you so much brothe_ i'll try it hope you will always in GOD Blesses_
|
|
|
|
|
Hi there. If you want to program, you need a compiler right? Then go to Microsoft and download Visual Studio 2010 Express version to use.
Even if you decide to learn VB.NET (just an improved version of VB), you still have to decide if you want to learn to program for Windows or for Web. My advise is to learn how to program for web first. That could be a bit easier to start with.
Once you become more confident in web programming, then you may switch to Windows programming.
Good luck.
|
|
|
|
|
how get hardware serial no. because one pc one software & get hardware serial genrator for my project in vb 6.0 plz send this code for get hardware serial .
thanks
kamal prajapati
|
|
|
|
|
Have a look just 2 threads down from your post.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
See also this question[^]; are you the same person?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Someone please help me. I need to resize the image I am retrieving from the database so that it can fit into a picturebox on a vb.net form. I want the image to be viewed more like we view a preview of an image. I dont want the original picture to be altered though.
please help
|
|
|
|
|
There is PictureBox.SizeMode with a lot of choices for you.
|
|
|
|