|
Hi, I am new to Silverlight.I have created a simple silverlight application which uses a WCF dataservice to fetch some data from database.The WCF service is inside the application itself.The application runs fine in my development environment.But when I host the application in IIS,whenever the application tries to communicate with the WCF dataservice, it throws some error saying,"Unhandled error in silverlight application,An Exception occured during the operation,making the result invalid.Check inner exception details at System.ComponentModel.AsyncCompletedEventArgs.RaiseExecptionIfNecessary at
SQLData.ServiceReference1.GetCustomerByTerrytoryEventArgs.get_Result() at
...................................
The System.ServiceModel configuration is web.config is given below :
<pre>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="SQLData.Web.Service1Behavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="SQLData.Web.Service1Behavior" name="SQLData.Web.Service1">
<endpoint address="" binding="basicHttpBinding" contract="SQLData.Web.IService1">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
</pre>
I am totally confused....I searched the web...and applied everything they said....but still getting this error......Please help me solve this issue.
<font style="color:Green;font-family:Courier New;font-weight:bold;">C</font><font style="color:Blue;font-family:Courier New;font-weight:bold;">C</font><font style="color:Pink;font-family:Courier New;font-weight:bold;">26</font>
|
|
|
|
|
|
Thanks for posting the solution.
You could however format it using PRE tags to make it more readable.
|
|
|
|
|
I've several WPF Control-Library type projects in a solution. Build provides DLLs for each project.
How can I combine these user-controls into a single DLL? And, show a particular control based on XAML specification when used in a project? What should be approach to do this?
May be in XAML, to display controls, we just need to write something like this
<Window xmlns:CombinedControl="SomeThing">
<Grid x:Name="LayoutRoot">
<CombinedControl:Control1/>
<CombinedControl:Control2/>
<CombinedControl:Control3/>
<CombinedControl:Control4/>
</Grid>
|
|
|
|
|
Alright - I've only found two way for accessing a sql database from a silverlight app:
- Using RIA Services
- Using a web service
Is it possible to do this without using either of those two methods? We're on a DOD network, and getting permission to deploy stuff like web services or even ria services is a frakking nightmare, and we'd like to avoid it if we can.
Can I just create a regular .Net assembly with the ADO stuff in it and use that? (see EDIT #2
EDIT #1 ==============
If there is no other way, I've gotten to the point where I have a domain service created, but I haven't been able to determine how to actually use it. I don't want to bind to a control. I simply want to get at the data, and every example I've found on the net assumes I want to bind to a frakking control.
EDIT #2 ==============
Well, you CAN'T add a non-silverlight assembly reference, and since you have to use a Silverlight assembly, you of course can't use System.Data.SqlClient . I don't think it could get any less convenient.
.45 ACP - because shooting twice is just silly----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
modified on Wednesday, April 21, 2010 9:36 AM
|
|
|
|
|
My experience with silverlight in a browser
is , it has all the network capabilities of the
browser its in. So of course it's only going
to make requests on port 80. So basically if
you cannot connect with browser to you sqlserver
then silverlight wont either. Your best bet
is a web service . But maybe
move on up to the Cloud with Azure.
|
|
|
|
|
Azure is completely off the table. No way, no how, will we use Azure.
I've already started writing a web service.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
A third way is to use the Entity framework directly, although RIA services could be considered as a subset of that (or vice versa).
|
|
|
|
|
There is no way you'll get this working. Even if you run Silverlight 4 in Elevated trust, the only thing you'll get is access to the clients file system.
Of course you could build a HTTP-REST based service that just accepted full SQL Queries from the client, and return the resultset, but the the security can of worms that you'd be opening then are horrendous. This is not just SQL injection, this is open doors on your database. I doubt the DoD would be happy.
No, RIA services it should be (and,no you can't get at the data), except through a web service.
|
|
|
|
|
|
Once I convert a WPF control into UserControl, Some of its Common Properties get disappeared. How can I retain properties like 'Content', 'GroupName' for a RadioButton control after conversion?
|
|
|
|
|
After you convert something into a user control, it is now embedded within that user control. You have to create properties to interact with the control you have just converted into a user control.
|
|
|
|
|
Hi,
i have a gridview and in style of celltemplate i define tooltip equals to whatever content that cell have. So it will display blank tooltip while content equals to null.
So what to do for not displaying tooltip if data is not available in cell?
Any tricks in datatrigger??
Solved :
Done by writing following code :
<DataTrigger Value="{x:Null}" Binding="{Binding Content, RelativeSource={RelativeSource Self}}">
<Setter Value="false" Property="ToolTipService.IsEnabled"/>
</DataTrigger>
modified on Tuesday, April 20, 2010 6:53 AM
|
|
|
|
|
Hi Experts,
I have defined a control template in a resource dictionary which is in a different project (lets call it project A) and I want to use this in a project which has many wpf windows (lets call it project B). So I have added this dictionary to my application resources of project B as
Uri uri = new Uri(@"C:\ProjA\Dictionary.xaml", UriKind.Absolute);
ResourceDictionary dict = new ResourceDictionary();
dict.Source = uri;
Application.Current.Resources.MergedDictionaries.Add(dict);
This code is working like a gem!
I want to convert this absolute path to a relative path. I have added the dll of project A as reference in project B. I have tried various permutations and combinations but not able to get it as
Uri uri = new Uri("/ProjA;component/Dictionary.xaml", UriKind.RelativeOrAbsolute);
I think i am doing something wrong here but unable to figure out.
Please help!
Thanks in advance!
Regards,
Samar
Note: This dictionary is in the root folder of project A.
|
|
|
|
|
|
I'm currently trying to grab data by using C Sharp with the Silverlight Framework. The request does not seem to go through though because I'm trying to pull data off a website that appears to use .NET and uses a postback to return the information.
I'm using the following method to try and submit the request:
GlobalVariables.client.UploadStringAsync(new Uri(GlobalVariables.stopRequestUri), "__EVENTTARGET=&__EVENTARGUMENT=&txtSearch=springfield+and+busey&cmdSubmit=Search");
stopRequestUri = http://stopwatch.cumtd.mobi/Default.aspx?__ufps=841248 and client is of type WebClient
When I've used Fiddler to check how the request is going through, it can execute the request just fine and appears to include some sort of redirect. I can't seem to get my own code to do the same thing.
I'm pretty much trying to submit the form with something like Springfield and Busey and then have it bring up the bus stop times for that intersection just like it would appear in the web browser.
Any ideas?
|
|
|
|
|
Hi folks!
Is there a way to do some preloading of images in WPF?
My Image has an URI as source (a URI property implementing INotifyPropertyChanged in the code behind)
When I create the URI (points to a network share) and fire the NotifyPropertyChanged Event, my application freezes for a second or two.
So how can I preload the image so the applicatio won't freeze?
Here's some code:
XAML:
<Image Source={Binding Path=Image_1, NoitifyOnSourceUpdated=True}/>
And the CB:
public DataContextClass : INotifyPropertyChanged
{
private Uri image_1;
public Uri Image_1
{
get
{
}
set
{
image_1 = value;
PropertyHasChanged("Image_1");
}
}
void Timer_Elapsed(object sender, EventArgs e)
{
Image_1 = CreateUri(GetFilePathFromNetworkShare());
}
}
Thanks in advance!
eza
|
|
|
|
|
I would tend to read the data in using a background worker and marshall the image back to the UI thread once it's been read in. Whenever you see a UI that's stopped responding, you're seeing one that needs to have some threading in place.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
That's true, for sure - but as a matter of fact up to now wpf is doing the black magic (inclluding the dispatching), I'm just passing an uri.
Can this be done with some sort of lazy loading (heard once of that during a dev training) or other obsurce xaml tags?
Or is creating an image out of the uri (including the preloading) and passing it to the xaml as imagesource the better way? Won't the problem keep existing as the dispatcher has to deal with the pictures and their transformation-rotation anyway?
|
|
|
|
|
Have you tried WritableBitmap? you can return a empty WritableBitmap, start a thread to load your URI, then when the loading is finished, update it back through Dispatcher :
writeBitmap.Dispatcher.Invoke(DispatcherPriority.Background,
new ThreadStart(delegate
{
//UI Thread
Int32Rect outRect = new Int32Rect(0,
(int)(writeBitmap.Height - height) / 2, width, height);
writeBitmap.WritePixels(outRect, bits, stride, 0);
}));
Thats what I did for my FileToIconConverter.
|
|
|
|
|
I have an image lock.png beside of my WPF exe file in the images folder. Now, I'm gonna load it into the WPF Project as an image.
I've used the following XAML code:
<Image Stretch="Fill" Source="pack://siteoforigin:,,,/images/lock.png" />
It works, but Expression Blend or Visual Studio doesn't show it when I'm working on the project.
How can we show external images in these situations?
|
|
|
|
|
Hi,
I have an image lock.png beside of my WPF exe in the images folder.
Now, I'm gonna load it into the WPF Project as the App's icon, I've use the following XAML code, but it doesn't work :
Icon="images\lock.png"
How should I load an external image into a WPF application?
Thanks
|
|
|
|
|
|
|
REPOST - this question has also been put in the Q&A section.
|
|
|
|