|
rag_Singh wrote: How can i use ref key word on service class
What kind of service? If WCF, see here:
Designing Service Contracts[^] ("Out and Ref Parameters" section)
rag_Singh wrote: get value of that reference type variable on .xaml page
What do you mean?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
My code is as bellow on services1.svc.cs page
[OperationContract]
public DataTable getEmpCode(System.DateTime dt1, System.DateTime dt2)
{
string s = "";
tbl1 = createTable();//tbl1 is a DataTable
//createTable() is a function which generating table and return it
db = new DataClasses1DataContext();
var objECode = from user in db.UserMgmts
where user.ProjectName == "WapCos"
select user;
//return objECode.ToList();
List<UserMgmt> l = objECode.ToList();
int intCount = objECode.Count();
for(int i = 0; i < intCount; i++)
{
drw1 = tbl1.NewRow();
drw1[0] = l[i].ECode.ToString();
s= getCost1(l[i].ECode.ToString(), dt1, dt2);
drw1[1] = s;
tbl1.Rows.Add(drw1);
}
return tbl1;
}
i want to retrive data of tbl1 on page.xaml.cs page by clicking any button.
|
|
|
|
|
First of all, Silverlight doesn't have a DataTable class...
Is this your own class?
Second, I don't see anything having to do with "ref" there.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Actually firstly i was using ref type variable since i had no idea of using ref keywords in silverlight so i changed my logics and used there DataTable but i came to knew from you that Silverlight don't have DataTable class.
Over all i am getting some data by Linq and kept it in DataTable after performing few manipulation.Function that creates DataTable is as bellow.(all code are written on Services1.svc.cs page)
public DataTable createTable()
{
DataTable tbl2 = new DataTable("UserCost");
DataColumn DC0 = new DataColumn("DT_ECode");
DataColumn DC1 = new DataColumn("DT_Area");
tbl2.Columns.Add(DC0);
tbl2.Columns.Add(DC1);
return tbl2;
}
To create DataTable I add using System.Data; namespace
Function that performs operation and keeps data in a table is:
public DataTable getEmpCode(System.DateTime dt1, System.DateTime dt2)
{
string s = "";
tbl1 = createTable();//tbl1 is a DataTable
db = new DataClasses1DataContext();
var objECode = from user in db.UserMgmts
where user.ProjectName == "WapCos"
select user;
//return objECode.ToList();
List<UserMgmt> l = objECode.ToList();
int intCount = objECode.Count();
for(int i = 0; i < intCount; i++)
{
drw1 = tbl1.NewRow();
drw1[0] = l[i].ECode.ToString();
s= getCost1(l[i].ECode.ToString(), dt1, dt2);
//s is some manipulated value against every ECode by another function
//getCost1(string empCode,date1,date2){some codes...}
drw1[1] = s;
tbl1.Rows.Add(drw1);
}
return tbl1;
}
My objective is to use tbl1 data on Page.xaml.cs page.Then what should be another way to use this tabular data on Page.xaml.cs page instead of DataTable.
modified on Wednesday, November 11, 2009 12:37 AM
|
|
|
|
|
rag_Singh wrote: what should be another way to use this tabular data on Page.xaml.cs page instead of DataTable.
Using LINQ to Dataset to reshape the data into types that are compatible
with Silverlight is popular.
There's also ADO.NET Data Services[^] and
RIA Services[^].
RIA services is not officially released yet, but it has a go-live license.
It's currently my favorite platform for n-tier Silverlight development as it
works nicely with ASP.NET services.
I recommend searching on "Silverlight DataTable", "Silverlight DataSet" or similar.
There's lots of info and examples floating around, like this[^].
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
How is the idea of Writing and Reading xml file.
My mean Writing data of DataTable in xml file from services1.svc.cs
page and again Reading that xml data from page.xaml.cs page.
i want your best suggetion..
|
|
|
|
|
I prefer to use strong types where possible so my preference is
WCF or RIA Services.
But there's nothing wrong with Plain Old XML (POX).
Unfortunately Silverlight doesn't have binding-to-xml (XPath)
features so you may need to use something like LINQ to XML on
the client end to translate the XML into typed objects for binding.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I want to replace the 'plus', 'minus', 'blank' icons for the expand/collapse button of a TreeViewItem with my own images. Can that be set by defining a style? If so, does anyone have an example?
While on the discussion of element styles, where does one find the default styles and templates applied to various Controls?
modified on Saturday, November 7, 2009 12:21 PM
|
|
|
|
|
Already found what I was looking for. For anyone else, this might help:
ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/wpf_conceptual/html/6bea1014-2555-425c-9f79-3f31a487bab3.htm
|
|
|
|
|
|
Cute.
I've never heard of the term "fun badge", so I looked it up.
Fun Badge[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
If you are accessing through HTTP you need to provide a clientaccesspolicy.xml in the root of the site.
My question is for the TCP access, it appears you must setup a TCP listener on the TCP address where Silverlight is accessing on port 943. Correct?
It has nothing to do with the hosting web server. Right?
Thanks
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
earlgraham wrote: If you are accessing through HTTP you need to provide a clientaccesspolicy.xml in the root of the site.
Only if you'll be accessing resources on a domain other than the
one the Silverlight app is hosted on. Then the target domain must
have the policy file at its root.
earlgraham wrote: It has nothing to do with the hosting web server. Right?
Correct. You have to supply the server code (listening on port 943)
that returns the policy information.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am currently developing the application I asked about earlier and when I run (debug mode) the application I get the security exception, So I go to the properties and set the security setting to full trust and that solved the problem. Now when I deploy the application to localhost I get Trust Not Granted so I was wandering how to solve this problem so that I can move on with Implementing the other design items?
|
|
|
|
|
Never mind I found a couple of solutions
1. Link[^]
2. Link[^]
3. Link[^]
4. Link[^]
Hope this helps anyone facing the same problem
|
|
|
|
|
And how can I get rid of it? I've been able to remove the RowHeader on the left side but the upper left hand corner remains.
While I am at it, I've data binded my DataGrid to an observable collection and when the collection is empty, I get a weird error where that upper left hand corner of the DataGrid begins to stretch all the way to the right and locks the program up. It seems to be stuck on a "OnResize" event in according to the disassembly.
|
|
|
|
|
Can you post a simple example that shows what you are referring to?
I don't see anything on my DataGrids in the upper left corner,
but my property settings could be vastly different than yours.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Image of what I'm speaking of
What my big problem is when I have an empty collection in my data binding, this area area stretches all the way to the right and locks up my program completely. It's stuck in a response to OnResize event I believe, but I'm not entirely sure why an empty collection would cause this.
|
|
|
|
|
I appreciate the picture but I meant a code sample
I have no idea what kind of collection you're binding to
or how you are configuring the DataGrid.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm researching if an idea we had today at a meeting is possible.
What we need to do is embed an ASP.NET project inside a WPF app. I'm not talking about a browser feature, the ASP.NET app is not published on any server. The idea is to avoid any server setup.
Anyone know if this is possible, or not?
Where it seems there are only borderlines, Where others turn and sigh, You shall rise!
|
|
|
|
|
Why do you want to embed an ASP.NET app inside a WPF one? Could you please elaborate on what you're trying to achieve here?
"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
|
|
|
|
|
It's for demonstration.
The idea is to be able to send the customer a few demo web apps.
The demos should work out-of-the box without any setup.
I know the first idea is to have the demo apps available online, but due to some product specifics, we prefer not to.
Where it seems there are only borderlines, Where others turn and sigh, You shall rise!
|
|
|
|
|
This is an insane question. You'd have to ship your website code AND make sure IIS was set up, then use a browser control to browse to it. How else could it work. The non retarded way to do this is to have the websites in question on a hidden server, which perhaps has some sort of security built in, to try to make sure that only your WPF app could browse to the sample site.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
In Windows Forms, when I set the position of an UIElement I do it that way:
UIElement.Location = new Point(X, Y);
UIElement.Location.X
UIElement.Location.Y
How can I do this simple task in Silverlight, for example with canvas, called "MyCanvas";
MyCanvas.Margin.Left
MyCanvas.Margin.Top
What is this Margin about?
|
|
|
|