|
Thank you Giorgi for the link, I checked out the link, but it uses Reporting Services. and I don't want to use Reporting Services.
My application is actually a Point of Sale which prints the Transaction Bills (embedded report).
Showing the report in the reportviewer and then showing the print dialog irritates the user
alternately, is there any way to print the report to the default printer without showing print dialog.
thank you once again.
|
|
|
|
|
I am trying to datasource a gridview within a repeater. I am having issues passing the data from the repeater to the gridview (either to source it manually or set the Gridview's SQLDataSource attributes wtihin the Repeater_ItemDataBound event.)
The XML will look similar to this (all dummy data):
<root>
<Unit type="District" number="221">
<Employee name="Joe Smith" unitType="Store" unitNum="2213" reviewStatus="Pending" empNum="12345"></Employee>
<Employee name="James Jones" unitType="Store" unitNum="2365" reviewStatus="Pending" empNum="23654"></Employee>
</Unit>
<Unit type="District" number="254">
<Employee name="Rosie Worcester" unitType="Store" unitNum="2369" reviewStatus="Pending" empNum="26358"></Employee>
<Employee name="George Washington" unitType="Area" unitNum="254" reviewStatus="Pending" empNum="95682"></Employee>
</Unit>
</root>
I need an asp:Label within the repeater to load the <Unit> type and number and then pass the employee information to the gridview. Any suggestions on how I might do this? I cannot directly access the Gridview or SQLDataSource within the Repeater_ItemDataBound event.
Thanks in advance!!
K. Garl
|
|
|
|
|
I have a dateTimePicker control on my form and I am working on a payroll entry form. I want the datetimepicker to default to the following sunday for the period ending date, if the user selects a day during the week. does anyone have any suggestions on how i could do this using the ValueChanged event?
Thanks
|
|
|
|
|
DateTime dt=DateTimePicker.Value;
dt=dt.AddDays((7-dt.DayOfWeek)%7);
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
That worked wonders, I can even use the same logic to grab the beginning of the week.
Thanks
|
|
|
|
|
Hi all!
I have a class like this:
class A<br />
{<br />
private string strA;<br />
private B mySubclass = new B();<br />
...<br />
<br />
class B<br />
{<br />
public B()<br />
{<br />
string strB = strA
}<br />
}<br />
}
Is there a way to make strA visible only for class B and not for other classes? If not can you suggest a workaround to do that?
Thank you.
Luca
|
|
|
|
|
You could... pass a reference to your strA to class B through its constructor.
Or, you could probably do something with delegates. I must check up on delegates one day.
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|
|
Thank you! I thought to do that too. It seems to be the simplest way to obtain that I asked
Hope that helps!
Luca
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks!
|
|
|
|
|
If it actually was a subclass, you could just make the string protected.
As B is not a subclass at all, you can't do that. You have to pass a reference to the instance of the class.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Thank you for the answer! And how can I do to make B a "real" subclass?
|
|
|
|
|
devzav wrote: And how can I do to make B a "real" subclass?
Inherit from the A class:
class B : A {
...
}
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
I need the "like subclass" I used in the example. So I'll pass a reference to B.
Thank you very much for your answer!
|
|
|
|
|
guys third time posting the question but in vain
i have a table Employee Info in sql 2000
having attributes
EmpID
EmpName
GenID
GenID is a foriegn key of table Gender having attributes GenID and Gender
this.cGender.displaymember = "Gender";
till here every thing is okay
but here the problem arises
the following code is not working why
{this.cGender.valuemember = "GenID";}
i need this code to run bcoz i have to save the value of gender in the Employeeinfo
accoridng to following code
datrow.["EmpID"]= Emp.text;
datrow.["EmpName"]= EmpName.text;
datrow.["GenID"]= cGender.SelectedValue;
sas
|
|
|
|
|
Try writing the code without databinding to get it to work first. It is a good why to identify the exact problem.
Also, without rewriting set a breakpoint on the last line datrow.["GenID"]= cGender.SelectedValue; and examine what is actually in memory.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
|
Hi,
I've been searching on the internet for an age and haven't found yet found a solution to what looks like a easy problem. I was hoping you guys might be able to help.
Say I have a few web services like
a. service1.add(int num, int num2)
b. service2.subtract(int num, int num2)
and basically i want a generic runner that can call these services. The tricky thing is that one day I might want to add
c. service3.multiply(int num, int num2)
d. service4.divide(int num, int num2)
and I don't want to compile my generic runner again. All the services take the same number of inputs and return the same type of output. Is there any way of doing this.
From what I have read, it seems that the simplist way would be to use MSSOAP, I've managed to connect to an arbitary service, but don't know how you'd go about invoking the methods.
Thanks
|
|
|
|
|
Wii.lliam wrote: generic runner
My first suggestion is "don't make up terminology". In text based communications it is difficult for people to understand what you say.
Wii.lliam wrote: I don't want to compile my generic runner again. project
Using configuration mechanisms to avoid hard coding information into software is not a new concept. There are many ways to do it. One widely used approach today is to use XML files.
Wii.lliam wrote: I've managed to connect to an arbitary service, but don't know how you'd go about invoking the methods.
Again there are many ways to go about that as well and one is WSDL[^]
|
|
|
|
|
Can you somehow use reflection on web services? Perhaps all of your services (like service1, service2, etc. from your example) could export a property that returns a MethodInfo[] will all its methods, and you could call them (add, subtract, multiply, and divide) from that array? Does your main service know that all sub-services implement only those four methods, or could they implement some arbitrary unknown method that you want to export, like say sqrt? If the methods are known, then you could, upon finding a service, make a call to all the possible methods, and the ones that error MAY not be exported by that service, but the ones that work will for sure be available. So, for example, you set up service4, then your mainService would find service4, then make a call to service4.add(1, 1), which would error. Then you make a call to service4.divide(1, 1), which would possibly not error, in which case you would know that method is exported. I'm not familiar with web services, so I'm just throwing out ideas...
Jeff
|
|
|
|
|
Use an object as your parameter: (I typed this quickly but obviously use Properties)
public class Foo{
public string Method;
public int Num1;
public int Num2;
}
[WebMethod]
public void FooBar(Foo foo){}
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Thanks for the quick reply,
to clear things up, essentially I am trying to do this (I know the coding is wrong, just want to give the idea)
String address="htt://localhost:2299/Service1.asmx" (read from config)
Double num1=2,num2=3(read from config)
Service ser=new Service(address)
Double result=ser.method(num1,num2)
In the past, I can only invoke that service's methods if i add a web reference to it, but this would mean that I need to recompile the main project everytime I add a new service. I would know exactly which service to call and what methods it has.
--------------------------
So far I have managed...
string myURL = "http://localhost:2299/Service1.asmx";
SoapClient sc = new SoapClient();
sc.set_ClientProperty("ServerHTTPRequest",true);
sc.mssoapinit(myURL + "?WSDL","","","");
but again, I don't know how to invoke it's method (or even if it's possible) this way.
Thanks
|
|
|
|
|
I have built different application and I want to put all together as a suite. Any ideas?
a novice
|
|
|
|
|
Ofori Boadu wrote: I have built different application and I want to put all together as a suite. Any ideas?
Add them both to the same setup project.
|
|
|
|
|
Take a look at this article it describes how you could addeach application as a feature in an installer.
"You're very clever, young man, very clever," said the old lady. "But it's turtles all the way down!"
|
|
|
|
|
Oftentimes when applications are allowed into a suite they trash the place and you're left with a rather large repair/cleanup bill.
|
|
|
|
|
Several forms are displayed and each of them contains a plot. Just like the different figures in Matlab. Each them contains one button to edit the figure properties. When I click the edit button on the non-activated form, no reponse from the edit button for the first click! That means I always have to click or actiavate the non-activated form first, then the edit button can response. or I have to click twice the edit button to make it work (only for the first time). Obviously, this is not convenient. How to avoid the this problem?
thanks.
|
|
|
|