|
hello!!
i have a problem.
i did a report by crystal reports, when the query is simple no have problem, the application search the report and it appears, but when i have a query with
ex:
SELECT *
FROM Categories
INNER JOIN Products
ON Categories.CategoryID = Products.CategoryID
the application search the report but before it appears, the DataBase Login screen appears first.
How i do to decide it!
thanks a lot!
|
|
|
|
|
hi,
I don't know where your database located. If your db is in server machine using SQl server, you must provide an accessing permission in Enterprise Manager with Security item.
It seems to be a solution.
|
|
|
|
|
I have an application that loads a specified web page that it have a button i.e with label 'OK'.I need to know how can this button get clicked from my app without user doing this.
MKCoder
|
|
|
|
|
Try looking at firing the event or even just calling the method that would be called by the button click.
Why do you want to simulate a button click?
If you want to simulate a button click then you might need to look at firing a mouse click event.
Hope that gives some direction.
|
|
|
|
|
Pls give me the code to create a mail merge application using Asp.NEt & C#
let the noble thought come from every side-Rig Veda
|
|
|
|
|
2 questions
1.) Why are you trying to create a mail-merge application in .Net when Word and Excel and Outlook will do things like this for you anyway?
2.) Why do you think someone is going to write this for you from scratch?
Try some part of it and when you get stuck ask how to get past that point - there are hundreds and thousands of programmers on here who will be more than happy to help you but only if you help youself to begin with....
Mark.
|
|
|
|
|
Hi There Every Body,
I have a Form that its ctor defined like this :
public FrmOrder(Order order)
{
}
which "Order" is a predefined class.The object "selectedOrder" is an instance of class "Order".
Why Does this call change "selectedOrder" ?
FrmOrder frm = new FrmOrder(selecredOrder);
frm.ShowDialog();
Kind Regards : Ali
|
|
|
|
|
Because an Order is a class, and therefore a reference object. You pass the reference to the object, so there may be many variables all referencing the same physical object. So call a method on one reference that makes a change and everything that has the reference will see the change in the object.
This is different to a value object. In this case a copy of the object is passed, so if a value object is passed into a method then the code inside the method sees a copy of the object, rather than the version that was passed in.
|
|
|
|
|
Thanks Colin,
Whould u please tell me how should I Pass that instance By Value?
And what is the usage of "ref" keyword?
Thanks again.
Yours Sincerely. Ali
|
|
|
|
|
Ali Beirami wrote: how should I Pass that instance By Value?
You can't.
Ali Beirami wrote: And what is the usage of "ref" keyword?
To pass a value type by reference, such as an int.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanx.
Sincerely Yours. Ali
|
|
|
|
|
there is a very subtle use for the ref keyword for objects.
You are saying that you pass the reference by reference.
If you assign an object to a reference you have passed in by val, the reference is not altered when you return from the function. If you pass it in by ref then the reference will be updated on your return
Hope this makes some sense
Russell
<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
TestClass newClass = new TestClass("Initial");<br />
Console.WriteLine("Value after initialisation: " + newClass.TestValue);<br />
DoStuffByVal(newClass);<br />
Console.WriteLine("Value after byval: " + newClass.TestValue);<br />
newClass = new TestClass("Initial");<br />
Console.WriteLine("Value after initialisation: " + newClass.TestValue);<br />
DoStuffByRef(ref newClass);<br />
Console.WriteLine("Value after byref: " + newClass.TestValue);<br />
}<br />
private void DoStuffByVal(TestClass testObject)<br />
{<br />
testObject = new TestClass("Changed");<br />
}<br />
private void DoStuffByRef(ref TestClass testObject)<br />
{<br />
testObject = new TestClass("Changed");<br />
}<br />
class TestClass<br />
{<br />
public string TestValue;<br />
public TestClass(string testValue)<br />
{<br />
TestValue = testValue;<br />
}<br />
}
produces the following output
Value after initialisation: Initial
Value after byval: Initial
Value after initialisation: Initial
Value after byref: Changed
|
|
|
|
|
if it's the kind of object that you are likely to need to pass by val you should consider making it a struct instead. I'm thinking of classes like vectors, phone numbers etc which are often better as structs.
Russ
|
|
|
|
|
Hai I had a problem of exporting gridview control(or)dataset to exel sheet.So can u plz provide code with namespaces
|
|
|
|
|
I created simple DialogBased Windows application using C#
I want to check if user has entered any control characters in the edit box.
For Ex: in the edit box user can enter value like
ALT + 8 (BackSpace)
ALT + 9 (Horixontal Tab ) etc
Though it looks funny but I want to discard this input.
I tried to convert the string to int and check ASCII it did not work
EX:
Int32 nLength = str.Length;
for(int i=0;i<nlength;i++)
{
int asciival="System.Convert.ToInt32(str[i]);"
if(asciival="" <="" 33="" &&=""> 0 )
Discard the input;
}
In this scenario for ALT + 8 I get asciival as 9688
ALT+9 as 9675.
This is to check whether control characters entered?
Why do I get ALT+8 as 9688 not as 8 asci value ?
I want to basically check if user has entered any control characters
like 1-32 or 127 ASCII value (Ex: ALT + 127) in the edit box. And discard the same.
FYI this edit box should allow any other non english characters like French, German, Chinese, Japanese etc
-- modified at 17:44 Tuesday 10th April, 2007
Thanks, Sandeep Naik
|
|
|
|
|
|
Thanks for your reply. Thats a good suggestion I appreciate it. But I don't want to restrict use from entering value like ALT + 65 , ALT + 117 which is valid value
Actualy I am sending this value to COM object as BSTR.
That is where I have my business logic written to validate the data entered.
So I wanted to first figure out how to do it in C# and then mimic the similar code in C++.
I found one website where they have table to show DOS equalent characters.
But I want to good technique to check the same
http://petesguide.com/WebStandards/entities/XHTML1.0-UTF-Latin-1entities.html[^]
-- modified at 18:46 Tuesday 10th April, 2007
Sandeep Naik
|
|
|
|
|
How can I get XslCompiledTransform.Transform() to write the result to a string instead of a file?
/\ |_ E X E GG
|
|
|
|
|
XslCompiledTransform xslt = new XslCompiledTransform(true);
xslt.Load(Server.MapPath(@"blog/blog.xsl"));
StringWriter sw = new StringWriter();
xslt.Transform(Server.MapPath(@"blog/master.xml"),null,sw);
blog.InnerHtml = sw.ToString();
/\ |_ E X E GG
|
|
|
|
|
I have some modules which have to be able to take some input parameteres, process it and serve some output parameters. The modules are implemented as a class and the parameter (input or output) might have different types from module to module. The references is stored as Object. I have tried to make a simple test setting where I have some user input supplied to the first module and the output of the first module is the input of the second etc.
firstInput -> mod1 -> mod2 -> readOutput
I have some real problems because the reference (input of mod2) to the output of the the previous module (output of mod1) is lost after the constructer terminates. I would appreciate any help, even if the solution is to approach it with a new design.
The code I have come up with so far is this.
class module
{
private object input;
public object output;
public module(object source)
{
this.input = source;
this.output = new int();
}
public void compute(int i)
{
this.output = (int)this.input + i;
}
public int getOutput()
{
return (int)this.output;
}
}
class TestClass
{
public static int test()
{
Object firstInput = (int)1;
module mod1 = new module(firstInput);
module mod2 = new module(mod1.output);
mod1.compute(2);
mod2.compute(3);
int result = mod2.getOutput();
return result;
}
}
-Lothver
|
|
|
|
|
Hello,
I might not completely understand what you are trying to do here, but this
Lothver wrote: module mod2 = new module(mod1.output);
makes no sence to me because the output has no value at that time.
If you compute mod1 before you create your mod2 instance, it would make more sence (I hope )
Hope it helps!
All the best,
Martin
|
|
|
|
|
Thank you for your answer.
In the constructor of mod1 the following line has been called, so mod1.output does hold a valid object.
this.output = new int();
It is however true that I have not written a value to the output yet, but the value is niether read by mod2. What I am hoping to do is to save the reference to mod1.output in mod2.input .
The value of mod1.output is written in mod1.compute() , and is attempted to be read by mod2.compute() but the reference is not saved in the private member.
I hope this clarifies the problem
- Lothver
|
|
|
|
|
Hello Lothver,
I think I understand what you want todo!
But I also think it's not possible in the way you are triing to implement.
Cause you will only give the reference of the actual value to the other modul.
I modified your test project that a notification is done if a value changed.
Therefore the input and output has to be a seperate class, which is a base IO class.
This class implements a ValueChanged event.
But I stop the explination write now and post the code.
class IO
{
private object value1 = new object();
public IO(object _value1)
{
value1 = _value1;
}
public IO()
{
}
public object Value1
{
get
{
return value1;
}
set
{
if(value !=value1)
{
value1 = value;
if(ValueChanged!=null)
{
ValueChanged(this, EventArgs.Empty);
}
}
}
}
public event EventHandler ValueChanged;
}
class module
{
private IO input;
public IO output;
public module(object source)
{
IO io = source as IO;
if(io!=null)
{
this.input = io;
io.ValueChanged+=new EventHandler(io_ValueChanged);
}
else
{
this.input = new IO(source);
}
this.output = new IO();
}
public void compute(int i)
{
this.output.Value1 = (int)this.input.Value1 + i;
}
public int getOutput()
{
return (int)this.output.Value1;
}
private void io_ValueChanged(object sender, EventArgs e)
{
IO io = sender as IO;
if(io!=null)
{
this.input = io;
}
}
}
class TestClass
{
public static int test()
{
Object firstInput = (int)1;
module mod1 = new module(firstInput);
module mod2 = new module(mod1.output);
mod1.compute(2);
mod2.compute(3);
int result = mod2.getOutput();
return result;
}
}
Please tell me if it is working for your needs, although it's not what you wanted!
All the best,
Martin
-- modified at 9:18 Wednesday 11th April, 2007
|
|
|
|
|
Lothver wrote: The modules are implemented as a class and the parameter (input or output) might have different types from module to module. The references is stored as Object.
You really should look at implementing this using generics. Storing everything as an Object is expensive because you are getting hit with boxing/unboxing operations (converting from reference to value types and vice versa) all over the place.
The problem you are seeing is a result of the way your Compute function works. This function takes the value of i , adds it to the value in input and stores it in output . The only time input gets set is during construction.
If you step through this in a debugger you will see the following sequence of events:
module mod1 = new module(firstInput);
mod1.input == 1
mod2.output == 0
module mod2 = new module(mod1.output);
mod2.input == 0
mod2.output == 0
mod1.compute(2);
mod1.input == 1
mod1.ouptut == 3
mod2.compute(3);
mod2.input == 0
mod2.output == 3
You either need to change the order of your calls or change your compute function.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Thanks for your answer
I am sorry but I dont think I have made it clear that I want the input to be like a pointer in C++, which I know can not be done (at least not in managed/safe mode). If I were to write the code in C++ I think the constructor would be like this.
public Module(Object* source)
{
this.input = source;
this.output = new Object();
}
and later the constructors will be called like this
mod1 = new Module(&firstInput);
mod2 = new Module(&mod1.output);
- Lothver
|
|
|
|