|
Why would you like to do that?
Could you provide the exact requirement?
Regards,
Dave
Dave Traister
Software Engineer
ComponentOne LLC
www.ComponentOne.com
|
|
|
|
|
If I have a Select statement such as-
[ItemCost]*[ItemQuanity] as ItemSubtotal
How do I name the ItemSubtotal column in another select statement so I can-
[ItemSubtotal]-[AmountPaid] as BalanceDue
When I try this it does not know the ItemSubtotal as a valid column name since I created it in a as column name.
Thanks for the help......
|
|
|
|
|
You can't refer to columns by their alias until the ORDER BY clause because they haven't been serialized as the alias until then. So you have to define your two columns as:
SELECT (ItemCost * ItemQuantity) AS ItemSubtotal,
(ItemCost * ItemQuantity) - AmountPaid AS BalanceDue
If you're using SQL 2005, you could write a user defined function, call it subtotal and then use CROSS APPLY like this:
SELECT S.Subtotal AS ItemSubtotal,
S.Subtotal - ItemQuantity AS BalanceDue
FROM OrderDetails
CROSS APPLY dbo.GetSubTotal(ItemCost, ItemQuantity) S
But if your query isn't returning a large number of rows I really wouldn't worry about it and I would use the first method.
|
|
|
|
|
Mark,
Thanks for the help!
|
|
|
|
|
I have created an application using C# 2003
It runs well sometimes, and sometimes it gives the following error
"unable to find a version of the runtime to run this application"
Everytime this message appear, I have to rebuild my application
How to resolve this
Mohammed Gouda
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
And you didn't modify the machine.config file?
|
|
|
|
|
No
Where is that file?
Mohammed Gouda
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
I have a datagrid bound to a table in my database. I want one of the columns, which does not allow for nulls, to be filled with choices that I will supply beforehand. So I set up what was in this case the third column as a combobox and supplied it with my own list of values. Initially when the form loads, the values are displaying correctly (all rows have data in them) and I can select a value from the combobox, however, when I click off the row I keep getting an error saying datanonullallowedexception. All the rows appear to be filled. Is there a way for me to use the values that I am presupplying to be saved in that third field. (I know that a proper db schema would have parent-child tables for the column but for whatever reason I need to do it for the person this way.) The code I am using is simple for the the third column:
Me.DataGridViewTextBoxColumn3.DataSource = productsrows
Me.DataGridViewTextBoxColumn3.DisplayMember = "Product_SKU"
Any help is greatly appreciated.
|
|
|
|
|
Hi All,
My web application is taking too much time to release the page after it loads completly.
Scenario:
I have 9 views in a single page and some views have link with controls in other views. There is no problem with the page load/refresh, afetr it loads the progress bar stays still for some time ie., it doesnt release the page to the user.
Maximum users in the system would be 2600, but as per my perception it doesnt really hurt the application, since it loads quick but takes time to release the page(Struck). Today only 102 users logged into the system at peek time.
Please someone suggest how to tackle this issue.
Im using framework 2.0, SQL Server 2005 and IIS 6 in Windows 2003.
Thanks,
Bala
|
|
|
|
|
|
Hi everyone.
My customer has a COM object called validatecom.dll. I need to use this in my VS2005/C# web service. So I used tlbimp.exe to create a Runtime Callable Wrapper for validatecom.dll, defining the namespace as "wsl" because that makes sense in their environment. The COM interface is called IValidate, thus giving me a class called CValidateClass.
In my unit test, which runs as an ordinary .NET application, I can instantiate a wsl.CValidateClass object and call methods on it. No problem.
When I try to instantiate wsl.CValidateClass in my Web Service, however, I get an error, to wit:
System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID... yadda yadda yadda... failed due to the following error: 80070005.
And as we all know, 80070005 is another way of saying "Access Denied." Now I'm wondering why I can access the RCW assembly from an ordinary application, but not from a Web Service. I tried giving "full control" rights to "everyone" on that RCW assembly, but still no joy.
Any ideas on this? I'd be happy with a pointer to an MSDN article, a Google term, anything!
Thanks to all for your help.
|
|
|
|
|
|
Well Mike, yes and no.
I've got the Runtime Callable Wrapper, and I can use it (still) from an ordinary console application, but I'm still getting those errors when I try to instantiate the object from within a web service.
I found out that when I just try to load the assembly directly using System.Reflection.Assembly.LoadFile(filename) it fails with the same error. But System.Reflection.Assembly.LoadFrom(filename) appears to work, as does System.Reflection.Assembly.ReflectionOnlyLoadFrom(filename).
When I use System.Security.Permissions.FileIOPermission to determine my ASPNET user's rights on the assembly DLL, it tells me I have full rights, so it's not a matter of file access.
And I pulled apart the reflection data to find that I'm depending only on mscorlib, which can't be the problem either.
I finally tried signing my RCW assembly just in case it was ASPNET not wanting to run unsigned code.
So... it looks my specific question is: what is it about the ASPNET environment that makes loading a RCW assembly (or any assembly?) so different from a console environment? Is there a document that addresses that?
Thanks to all.
|
|
|
|
|
Hi,
I have a problem to make a CAB file for my project exe (create in Visual studio 2005, C#) into PocketPc 2003. When i execute a cab on a PDa with pocketpc 2003 I retrive an error: "It's not a valid CAB file for windows CE".
The CAB work perfectly on PDA with windows mobile 5.0.
Why? I can create a CAB file compatible with pocketpc2003?
Thanks a lot.
Alex
|
|
|
|
|
|
i wanna know that Application.Run only takes only from objects as a parameter like
Application.Run (new MYfrm1);
OR it can also take parameter other than windows form like Class Objects?
|
|
|
|
|
Double Post - please ignore.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Hello,
I have this piece of code which i am using in my application developed on VS2003. i have migrated the code to VS2005 and have cleaned the code, but now i have to port it to Vista.
The code uses SHFILEOPSTRUCT and SHFileOperation which are nwo deprecated and a new interface IFileOperation has been introduced for Vista. I did a lot of head banging but still i could not figure out how to modify my code except the use of SetOperationFlag() function of IFileInterface. So please see if you could help.
Here are the snippets
<br />
SHFILEOPSTRUCT shfileop;<br />
<br />
shfileop.hwnd = NULL;<br />
<br />
shfileop.wFunc = FO_DELETE;<br />
<br />
shfileop.pFrom = pstrfrom;<br />
<br />
shfileop.pTo = NULL;<br />
<br />
shfileop.fFlags = FOF_NOCONFIRMATION;<br />
<br />
shfileop.fAnyOperationsAborted = 0;<br />
<br />
shfileop.hNameMappings = 0;<br />
<br />
shfileop.lpszProgressTitle = 0;<br />
<br />
SHFileOperation(&shfileop);
I get the pFrom and pTo from LPCTSTR type strings. I would also like to know about the double null termination of strings.
Thanks and regards,
Mustanseer
|
|
|
|
|
SHFileOperation is deprecated, not removed. Deprecation simply means that they have added a new method which they advise is used in future, and that they might remove the old way in future operating systems. However, IFileOperation is not available before Windows Vista which means that if you need to support older operating systems, SHFileOperation is the best choice.
The double null-termination is because SHFileOperation can work on a queue of items, not just a single item. Each item is a normal null-delimited string, and the queue is represented by all the item strings concatenated together. The end of the list is marked by an empty string, i.e. a single null character. To remove a single item, therefore, you pass the string (null-terminated) followed by another null, so it appears to be double-null-terminated.
Example: you want to delete items Item 1 and Item 2. Therefore you specify the string
Item 1<NUL>Item 2<NUL><NUL> I have to admit, I can't see how you get hold of an IFileOperation pointer. They seem to have forgotten to document that.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Hi Mike,
I agree SHFileOperation is deprecated but i wish to replace it with Vista compatible interface. the new version of my application is concerned only with running on Vista and later versions. i have got the idea of how to modify the code for copying, moving etc. but pertaining to deletion i am yet unenlightened.
Also, there is one more problem that i am facing. The new IFileOperation interface is placed in an Interface Definition Language file named "ShObjIdl.idl". i don't know how to import this file into my program to support the interface.
This is where i relate to you that how to get hold of the IFileOperation pointer.
PS: I am running my code on Vista currently and trying to debug.
Thanks and regards
Mustanseer
|
|
|
|
|
what is the use of PDB files on dotnet. i am developing a profiling application
shall i use the pdb file to point the exact code?
My small attempt...
|
|
|
|
|
|
as i said i am developing a profiling application.
in that i want to display the exact code using the pdb.
My small attempt...
|
|
|
|
|
Sorry about that, I guess I read too fast. I think the pdb won't do what you need though. The pdb file is basically used by the debugger to attach/link to its corresponding application. In the case of profiling, I've read before that .Net has a Profiling API.
|
|
|
|
|
i just used that, but in the case of user defined methods i want to point out the exact code
suppose i have a method "SayHello()" in my app, after profiling that will show
classname SayHello() 0.0000002(sec)
This is done successfully, now i want to display the exact code inside the method "SayHello{}"
My small attempt...
|
|
|
|