ASPFriends.com 'aspngcs' list Archive - June 2002
Messages
Page: 12
Programmatic Efficiency (5 replies)
ASPFriends.com 'aspngcs' list
Hello all, I am new to this forum and to the C# language. I have about 7 years of programming experience and am finding that C# is very easy to learn and use. The Visual Studio .NET setup makes life as a developer pleasant and rewarding. I have been using C# for about 3 weeks now. I'm going to use a random example of some code that I quickly came up with to demonstrate my question. In this example...
reflecting custom attributes... (8 replies)
ASPFriends.com 'aspngcs' list
This is a bit confusing, but IMHO its a bug. I have a set of classes which i want to add attributes to them. So i create my attribute class, and derive from Attribute, then add the needed attributes to my classes. Nothing new. It compiles and works fine. Next i try to reflect these attributes. So i get the type, and then attempt to pull out the CustomAttributes: object[] att1 type.GetCustomAttribu...
Efficiency in functions (7 replies)
ASPFriends.com 'aspngcs' list
Last week there was a thread going around about a palindrome function and we ended up with a real efficient function. I have a string replace function and was wondering if anyone had one better. I'll include it. Thanks Dot Net Guru private String Replace(String strText,String strFind,String strReplace) { int iPos strText.IndexOf(strFind); String strReturn ""; while(iPos! 1) { strReturn strText.Substring(0...
C# Array resize? (4 replies)
ASPFriends.com 'aspngcs' list
Is there a way to resize an array in C# or is the object immutable? If I need a dynamic array, will I need to create a new array object for each element I need to add? Can I use something like an ArrayList object and cast it to an array?
object architecture question (3 replies)
ASPFriends.com 'aspngcs' list
I must make a decision on this today, and would love any input. I have a class called Member, for members of my site. An object is created when a member logs in, is loaded with user's data from SQL, and is stashed in Session. The data that is stashed in the object is stored in DataTables, and represents user relevant data from tables like PersonAddress, PersonEmail, PersonCategory. My Question: Sh...
Cannot get business object to work ! (HELP) (2 replies)
ASPFriends.com 'aspngcs' list
I have created the following business object using System; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace BusinessObjects { public class Utility : System.Web.UI.Control { public void HelloLabel() { Label lb 3D (Label) Page.FindControl("myControl"); lb.Text 3D "Hello, what is your name"; } } } Then in my Page Load() function, I run the access code like this : Util...
Referencing classes from properties (4 replies)
ASPFriends.com 'aspngcs' list
If I want the following syntax to be used: Orders orders new Orders(); orders.OrderDetails.OrderDate DateTime.Now; orders.OrderDetails.ShipDate DateTime.Now.AddDays(2); orders.OrderDetails.OrderNum 1; orders.OrderDetails.PartNum 5; orders.OrderDetails.SalesRep "Jeff"; What's the best way to instantiate the "child" class referenced by the OrderDetails property? Currently I'm doing the following in ...
Using global variables... (16 replies)
ASPFriends.com 'aspngcs' list
Hi all, In the old school way of ASP application programming, you could store a series of global variables in an include file and reference those variables inside ASP pages. For example, if I wanted to set a variable called borderColor "red" then I could reference that variable % borderColor% . What is the equivalent in ASP.net to using a global variable like that? Where would you put it and how w...
Child of abstract class does not see constructor of parent (2 replies)
ASPFriends.com 'aspngcs' list
Hi list, Here is a sample: abstract class abs { public string field; public abs() { field ""; } public abs(string field) { this.field field; } } class real: abs { public real():base() {} } Now, when I try to real real1 new real("XYZ"); attemping to use constructor from class abs, it gives me: error CS1501: No overload for method 'real' takes '1' arguments Question: 1. Is this behavior by design of...
C# code to display a client window (5 replies)
ASPFriends.com 'aspngcs' list
Hello, Is there a way to display a popup window from the server? I want to display an error message when something happens. Is this possible ? The message should appear as a popup window. Best regards, Tim Musschoot
Universal date format (SQL Server) (3 replies)
ASPFriends.com 'aspngcs' list
SG93IGRvIEkgY29udmVydCBhIERhdGFUaW1lIG9iamVjdCBpbnRvIGEgc3RyaW5nIGxpa2UgU1FM IFNlcnZlcidzIFVuaXZlcnNhbCBEYXRhIFRpbWUgZm9ybWF0DQoNCkVnOiAyMDAyLTA2LTA1VDEw OjA2OjMxLjAwMDAtMDU6MDANCg0KSSB0cmllZDoNCk15RGF0YVRpbWUuVG9Vbml2ZXJzYWxUaW1l KCkuVG9TdHJpbmcoKQ0KDQpCdXQgZ290IGEgbm9ybWFsIGRhdGUuDQoNCg
Cached Objects (11 replies)
ASPFriends.com 'aspngcs' list
I have wrote test apps to come up with an answer, but I am looking for one last confirmation If I have an object(testObject) in the system cache of asp.net and 2 seperate Requests(threads) come in at the same time which trigger a "copy" of the object testObject (testObject)Cache["cachedTestObject"]; Does each Request now have its own distinct copy of testObject, meaning if the 2 requests then set ...
PInvoking GetDiskFreeSpaceEx (2 replies)
ASPFriends.com 'aspngcs' list
Anyone happen to have used above function via PInvoke? I'm not exactly sure how to correctly map the necessary ULARGE INTEGER struct. Chris
Redirecting to an aspx page (2 replies)
ASPFriends.com 'aspngcs' list
How can I redirect to an .aspx file from a class written in C#? I am in a method of a class and I would like to load an .aspx file by passing it some values via query strings. Can this be done? S
Playing wav file in C# (3 replies)
ASPFriends.com 'aspngcs' list
does anyone know how can i play wav file in C# applications? for example, whenever a button is clicked, a sound will be emitted. anyone? aiyuen Do You Yahoo!? Sign up for Video Highlights of 2002 FIFA World Cup
authentication in pop3 (4 replies)
ASPFriends.com 'aspngcs' list
Dan Wahlin dwahlin@xmlforasp.net wrote: If I want the following syntax to be used: Orders orders new Orders(); orders.OrderDetails.OrderDate DateTime.Now; orders.OrderDetails.ShipDate DateTime.Now.AddDays(2); orders.OrderDetails.OrderNum 1; orders.OrderDetails.PartNum 5; orders.OrderDetails.SalesRep "Jeff"; What s the best way to instantiate the child class referenced by the OrderDetails property?...
enumerating a collection while adding more items to it (2 replies)
ASPFriends.com 'aspngcs' list
Hello, Is it possible to enumerate a collection while still adding new items to it? One of my applications needs to populate a collection, then I need to walk through this collection possibly adding new items to the collection until no new items are found. (I am certain this will not enter an infinite loop). Is this possible? Is there a better way to approach this? Thanks, Scott Here is a quick (a...
Any Hex people out there? (4 replies)
ASPFriends.com 'aspngcs' list
Moved from [aspngfreeforall] to [aspngcs] by Marcie Jones marciejones@yahoo.com The desire to use C# to build a convertBase16toDecimal function is driving me a little nuts. I can do it in Jscript, Javascript and VB; but I am having problem with C# anyone know where there is a common base conversion article geared to c#? I have a site solution based on a custom guid built from various integer prope...
ArrayList item look up (4 replies)
ASPFriends.com 'aspngcs' list
I am having a problem using an ArrayList in one of my apps. Here are the requirements 1 be able to sort the items in the array based on a SortOrder property on the object 2 be able to retrieve an item from the array based on an object property value (not the array element id) 3 be able to enumerate over them (foreach) 4 encapsulate the ArrayList in a strongly typed collection no catsing needed out...
binary serialization & web services (3 replies)
ASPFriends.com 'aspngcs' list
Im using basic binary serialization to convert my object into a memorystream, and then throwing it over the wire as a byte[] in a web service call, matched up with a GUID. (size 256) I then take that GUID, and pull back the byte[] back over a web service, convert it to a memorystream, and then attempt to deserialize back into my object. (size 256) oh yeah..its being stored in the DB as VarBinary i...
Trace.Write not working (3 replies)
ASPFriends.com 'aspngcs' list
Hello All. I am trying to use Trace.Write in a method of a user control and it is giving me the following error: "CS0120: An object reference is required for the nonstatic field, method, or property " Any ideas? A bit more detail: The user control's Page Load event calls a method "Check". Trace.Write works fine in the Page Load event, but breaks in the "Check" method. Thanks, Stewart Haddock
Dynamic Control Value Setting in ASP.NET (2 replies)
ASPFriends.com 'aspngcs' list
Hi, I had Created a Dynamic Text Box. int i; TextBox txt new TextBox(); txt.ID "txtSkill" i; I will get the value from the dynamic text box through the specific command. Request.Form.Get("txtSkill" k).Trim().ToUpper(); But no I need to Assign a Value to that Text Box programmetically. How it is possible. Please help me on this regard. Through the find control method of the grid I can retrive the v...
Static methods in a dataclass (2 replies)
ASPFriends.com 'aspngcs' list
I am getting started on developing a DataClass to the n tier app I am building. One thing that is not very clear to me is whether I should have the methods (which would return Datasets, datareaders etc.) as static or not. What are the different pros and cons in going that route. One thing to keep in mind is that I might not access the DataAccess layer directly. There will most probably be a 'web s...
GC (3 replies)
ASPFriends.com 'aspngcs' list
Hey all, I was under the impression that, if you closed objects that you were finished with, the GC would eventually flush them out and free up some memory. I have written an application in C# that is a Windows Service. It basically is resposible for sending and receiving files. With each TCP connection made, there are basically three objects in use. A TcpClient, NetworkStream, and FileStream. All...
Uploading files from a client machine - C# (5 replies)
ASPFriends.com 'aspngcs' list
I am writing a webpage using C# and aspx. The purpose is to first upload a txt file selected by the user, read the file which contains a list of files to upload from the user machine to the server and into an SQL database. It is easy to upload the txt file using the input tag input id "UploadFile" name "UploadFile" runat server type "file" The next step after reading the uploaded txt file is to up...
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification