Silverlight Service Callback Returns Null
May 31, 2012
I'm trying to get data with the methods below and I get null response and can't figure out why. I'm just trying out a different way of using a wcf service from silverlight and I don't understand something that I should.[code]...
The employee object will stay null. If I put a break into the service call and follow through the code it finds the correct record from the database and the return statement shows an object with the correct data but still the employee object in silverlight side will remain null.
View 1 Replies
ADVERTISEMENT
Jun 24, 2010
I have some code which gets child items for a menu via the GetChildren function which takes a list of menuData: Dim builtMenu As New List(Of MenuData)(_rawData.FindAll(Function(item) item.GroupingID = 0))
For Each menuData As MenuData In builtMenu
If menuData.Children IsNot Nothing Then
menuData.Children.AddRange(GetChildren(menuData))
End If
Next
If I check if menudata.children isnot nothing, it always is nothing because the GetChildren function is yet to run (providing the child items, which do exist). If I remove this check and just have this code:
Dim builtMenu As New List(Of MenuData)(_rawData.FindAll(Function(item) item.GroupingID = 0))
For Each menuData As MenuData In builtMenu
menuData.Children.AddRange(GetChildren(menuData))
Next
Then I am presented with a Object reference not set to an instance of an object error on menuData.Children.AddRange(GetChildren(menuData))
View 1 Replies
Mar 1, 2011
I am creating a class ("Class B") which is used by another class ("Class A") which instantiates it in VB.NET 3.5.I would like Class B to read a value assigned to one of its properties by Class A every time an event happens in Class B.However, I would like this property value to be dynamically assigned to the property by Class A when the event is fired in Class B.I was thinking about somehow creating a delegate function in Class A that is linked to the property in Class B so that when the event is fired in Class B it would eventually invoke the delegate in Class A so that it returns a value to Class B.I've been reading around delegates (that's how I arrived at the idea), but I am stuck on how to code this up - could someone please help with some skeleton code?
View 1 Replies
Feb 12, 2011
I have been trying to figure this our for far too long and I cannot get my head around it. Every example I have seen seems to be far more complex that I need. I have a web service in my project (.asmx). I want to call it very simply from a button on a webpage.
Click
Run service asynchronously
return control back to webpage (web
service running in background)
View 1 Replies
May 6, 2011
I call upon your combined intellects. I have a web application with a silverlight app that calls a ria service. The ria service is defined inside the web application and everything else is just dandy.
The issue is this.It is my understanding that in order for the silverlight application to talk and know what the ria service is, you need to add a service reference for that service. The service reference defines the ria service and sets up the connection binding. One of the files it adds is the ServiceReference.ClientConfig which has the connection binding in it. During the course of this application's development, this is the way it was set up. And it worked perfectly fine locally and on the dev server.
Unfortunately there were issues when deploying to the clients in-house server. At this point I was onto other projects while my co-worker continued with the deployment. He soon became frustrated with the goofy errors that were occurring and recruited some help. This dev came in and, albeit got it working, but in order to do so he removed the service reference from the silverlight project but left the ServiceReference.ClientConfig which pointed to the location of the service in the web application(but that's it, no definition or explanation as to what the service does and I'm not sure how the silverlight app is supposed to know how to work with it..). This works perfect on my co-workers workstation and he has deployed this version to the clients server fine.
When I open the project it doesn't run at all. And the reason why is that it doesn't know what the service is that i'm using in code. Specifically, it doesn't know where this is (names changed for clarification):
Imports SilverlightApp.ServiceReference.WebApp.Service
I have cleaned the solution, completely deleted and got the latest from source control, built the web app first and made sure the asp.net dev server was running so that the address in the ServiceReference.ClientConfig resolved correctly. But, alas, it still doesn't know what Imports SilverlightApp.ServiceReference.WebApp.Service is.
So, to get it working on my workstation, I added the ServiceReference back but kept the current connection bindings so that it matched the endpoint in the web app web config. and changed the import statement to Imports SilverlightApp.ServiceReference and everything works fine.
View 1 Replies
Apr 13, 2012
I have a WPF application that uses a third-party library to perform a specific task; this library, in one of its methods, executes the statement Assembly.GetEntryAssembly(). If I run the WPF application on debug (by running a .Net exe for testing) the library works properly and Assembly.GetEntryAssembly() returns a reference to the assembly of the executable, but in production I have a different situation that causes me some problems.
[Code]....
View 1 Replies
Mar 1, 2010
I have the following code in my application. When it is executed it brings out a null value at times, where i am sure there should be a value returned. I have checked by running the sql statement in the database and it returns the correct value. What could be wrong with my code? [Code]
View 6 Replies
Oct 27, 2010
Rather interesting bit on this one, I have all the code where it should be working but whenever it hits parse1 it returns the file as null. [code] I probably just need a fresh pair of eyes because I'm not seeing where this is glitching (...or if it's just my computer in this case.)Rather annoying at this point, tried break points and following the execution to catch the error but no such luck.
View 2 Replies
Nov 21, 2009
I have some VB.NET code that creates a TransactionScope instance:
LoggingUtility.LogDebug("UpdateCallTable", "SatComCallDataImporter", "About to associate call data with contracts")
Using ts = New TransactionScope()
LoggingUtility.LogDebug("UpdateCallTable", "SatComCallDataImporter", "Getting all unimported SatCom calls")
My application is throwing an exception on the call to the creation of a new TransactionScope, with "Object reference not set to an instance of an object.". The exception isn't thrown on my development machine or my test machine; only on the customers production machine, and I have no idea why. I've placed debug lines immediately before and after this line so I'm positive it is this line causing the problem.
A have used TransactionScopes throughout the application and this is the only place throwing the exception on the client machine."About to associate call data with contracts" gets written to the log and the next log entry is the "Object reference not set to an instance of an object".
Code works fine if I move it out of a transaction.I've been struggling with this for 4 days now and have got no closer.
View 1 Replies
Apr 2, 2011
i hav two openfilefialogs(1 and 2). So i also have a listbox. the files opened with the openfiledialogs will be added to the listbox. and when i need to open the files i need to see if they are from which openfiledialog. so
it is like this.
Path.GetDirectoryName(OpenFileDialog1.FileName) & "" & Form3.ListBox1.SelectedItem.ToString
'if this returns a null then go to this
Path.GetDirectoryName(OpenFileDialog2.FileName) & "" & Form3.ListBox1.SelectedItem.ToString
View 4 Replies
Jul 22, 2009
Is their a more elegant way to assign a space to a value, if a database call returns null for a data set column? I am doing the following check which is pretty tedious:
If (ds.Tables("employee").Rows(0).Item("txtNamePrefix").IsDBNull(0)) Then
txtNamePrefix.Text = ""
Else
txtNamePrefix.Text = ds.Tables("employee").Rows(0).Item("txtNamePrefix")
End If
View 4 Replies
Oct 5, 2011
I have a DataGridView connected to a DataSet. I want to allow the user to update and insert new records on the RowLeave and CellLeave events. The Update method works:
Me.ExpensesTableAdapter.Update(Me.DataSet1.Expenses)
View 2 Replies
Oct 18, 2011
I am basically trying to access the CLSID portion of the registry... some CLSIDs are working, some arent...
Here is my code:
Dim regkey As RegistryKey
regkey = Registry.ClassesRoot.OpenSubKey("CLSID" & location & "InprocServer32", False) 'Just Returns null when im looking for a certain CLSID
Dim SubKeyvalues() As String = regkey.GetValueNames()
Dim subkeyvalue As String
subkeyvalue = regkey.GetValue(SubKeyvalues(0))
View 5 Replies
Jun 29, 2011
I'm converting a system of numerous programs from foxpro/foxweb/javascript to asp.net/vb/sql server.
I'm coding for a dropdownlist which is currently controlled via js.
I don't like using the control this particular way, but I want to maintain look and feel for the customer.
The control is initialized with some values via Page_Load() in behind code.[code]...
View 3 Replies
Jun 11, 2011
[Code]...
By my logic, this should only assign .length to index IF the length of strItem is longer than 0. This check is there in case the listbox is empty, or the user has not selected an item. However, everytime I go through this code without an item selected I get:
[Code]...
View 4 Replies
Apr 25, 2011
I have a several form elements that I am dynamically creating with javascript when a user changes a number value in a textbox, by filling the innerHTML of a div like so:
dfinnerhtml = dfinnerhtml + "<div class='field'> ";
dfinnerhtml = dfinnerhtml + "<textarea name='textbox1" + suffix + "' type='text' id='textbox1" + suffix + "' value='' rows='4' cols='20' class='field'></textarea> ";
dfinnerhtml = dfinnerhtml + "</div> ";
Then, in the aspx.vb code behind, when the user clicks the Save button, I run through a series of Requests to try and add the values that are in these form elements to a SQL string:
Dim DFTestValue1 As String DFTestValue1 = Request("textbox" & c.ToString)
where c is a loop counter to the # of textboxes created (the input value mentioned above that triggers the create) The problem here is that this code works in Internet Explorer but not in Firefox or Chrome. The Request() value returns null and nothing is saved. I hope I've explained this well enough.
View 2 Replies
May 18, 2010
I tried binding data to combobox at the runtime in the form load event. I had written the following bind function,
Private Sub BindComboBox()
Dim da As SqlDataAdapter
Dim conn As SqlConnection
Dim ds As DataSet = Nothing
[code]....
The problem is cboSubject.SelectedText is returning empty string.
View 3 Replies
Oct 25, 2011
I have a vb.net app that I can read a .xls file into a dataset or loop through as oledbdatareader and it gives the same result.Some of the rows have all nulls when I loop through them but if I open the same file in Microsoft Excel I can see that row fine.[code]From the info above the first two SKU values would come through fine but when I get to the 3rd row it would show a null.Is it possible that it kind of inherits the first rows type and since the 3rd row isn't all numeric if nulls it? [code]
View 1 Replies
Aug 11, 2011
I have been given the task of calling a web service which returns an xml data feed which I am doing like so:
For Each r As DataRow in SomeDataTable
Dim msFeed As String = string.format("[URL]?param={0}", r!SOME_VAL)
Dim x As XDocument = XDocument.Load(msFeed)
Next
This is all fine but as you can see x just gets overwritten with every iteration. What I need is create an xDocument and add each feed from my loop but I am unsure how to proceed.
Solution
Dim xAllFeeds As XElement = New XElement("Feeds")
For Each r As DataRow in SomeDataTable
Dim msFeed As String = string.format("[URL]?param={0}", r!SOME_VAL)
Dim x As XDocument = XDocument.Load(msFeed)
xAllFeeds.Add(x.Root)
Next
View 1 Replies
May 30, 2010
I'm connecting to a Web Service that returns a system.xml.xmlnode. How can I convert that to a datatable?
View 3 Replies
Feb 11, 2009
This same (Identical ) code works well in another program but does not in windows service... Returns 0 for window handle ...?
Public WindowStr As String = "ImagSrvWindow"
Protected Overrides Sub OnStart(ByVal args() As String)
'necessary to get control to paint Pic&Txt boxes in stream of Browser navs
[Code].....
View 7 Replies
May 8, 2012
I have a select statement which was returning the required values but when I changed the OS date from English(US) to English(UK), it now returns null. I believe the problem is concerned with date since in the query am selecting values where the date from the database is the same as the date in a combobox but I don't know what else I can do. It almost looks like the dates in the combox and in the database are not the same and yet the date in the combobox is actually retrieved from the database and has been returning values fine until I changed the system date format.Here's my select command:
cmd4.CommandText = _
"SELECT sum(brought_qtty), recieved_qtty from brought_coffee, centre_weigh where brought_date=#" & _
dtComb.Text.Trim & "#" & _[code].......
View 1 Replies
Oct 25, 2010
In a VB.NET application that runs as a service, I am getting a value of "Nothing" returned when I use Registry.CurrentUser.OpenSubKey(). The same code executes correctly when the application runs in desktop mode. I am not much on VB.NET and unfortunately, this is not my code.
Code:
Dim regURL As String = "SoftwareMyCompany" + _
System.Reflection.Assembly.GetCallingAssembly.GetName.Name + _
[code].....
View 1 Replies
Jun 17, 2011
I am having the same issues as per this question: WCF not deserializing JSON input..I am at a loss and desperate for a solution. I have scoured the net for answers, but I have found only this question that matches my exact problem. My datacontract parameter is also nothing when the service starts.I have tried the points of the answer in the question above, but they provide me with no clues (The web service executes OK -I am not getting any exceptions - and I can't see what the deserializer is doing - or not doing as the case may be).I am using POST, due to the size of the nested JSON.If more detailed information is needed, I will provide it on request.[code]
View 2 Replies
Sep 17, 2010
I am using vb.net sqlite.net and dblinq0.20.1 to search a sqlite table on a primary key field.My code looks like this
Dim blb = (From d In db.Data Where d.UID = myuid Select d).Single
This returns the error "Coalesce used with type that cannot be null" .If I search on a nullable field it works fine.
View 1 Replies
Dec 8, 2009
I am making use of a 3rd party dll and am encountering some strange behavior in VB, which doesn't occur in C# Perhaps someone can explain what is going on. Anyhow, I am making use of a method in this 3rd party library which accepts an array parameter ByRef. The end result is the variable should remain null after the method call, but it is returning initialized for some reason.
[Code]...
View 2 Replies
Dec 6, 2003
Code:
Application.DoEvents()
Error:
[code].....
View 3 Replies
Mar 19, 2009
I have a LOB app written in VB.NET with a WinForms front-end and SQL back-end. After many months weighing up how to get onto the Web, I decided last month to use Silverlight 2. Now, Silverlight 3 Beta is out, but there is no end-user runtime.
Does anyone know when the runtime will be available for deployment of SL 3 apps onto client sites?
My dev timeline is about 3 months: should I persist with SL 2 and then u/g to SL3, or jump straight in to SL3?
View 5 Replies
Jul 14, 2011
i have a Windows service that is hosting a WCF service through net.tcp and this is working great. I have also created a WCF service application. I am trying to add the net.tcp service reference to the service application. Then I add it to the GAC that goes ok but if I try to RegAsm the WCF service application to allow it to be called from Server.CreateObject I get the error:
Warning: Type library exporter encountered a type that derives from a
generic class and is not marked as
[ClassInterface(ClassInterfaceType.None)]. Class interfaces cannot be
exposed for such types. Consider marking the type with
[ClassInterface(ClassInterfaceType.None)] and exposing an explicit
interface as the default interface to COM using the
ComDefaultInterface attribute.
It does not work. I have tried to call it through a class library but this does not work either as the end point is not set correctly.
View 1 Replies
Feb 3, 2010
I have a VB2008 application which can control a windows service i.e. start, stop, pause etc. This runs ok on a Windows XP machine but not on a Win 7 machine (message is - Service error cannot open <service name> service on computer '.') ( if I stop the UAC then it runs ok ). It seems to be a rights issue,
View 3 Replies