Have a C# application. When I look in the project folder I see an .exe in bin/debug folder, when I click it executes the application fine. I also see the same .exe in obj/debug folder, when I click it executes but gives me error. What is the difference between these 2 objects and why do I have 2 of them?
I know that Session is for a single user , and application is for multi user purpose.The Data in the application object is shared. Right? Then how can access the application data from an another client.
have some Objects, lets say Employee and Role defined as below and I have defined relationships in my database that gives me a list of objects say employees and thanks to my framework each employee object also has a Role object linked via the RoleIDID, UserName, Password, Email, RoleIDRoleID, RoleNameSo in code I can do something like this
I know how to bind a simple objects to a dropdown list. However I am having problems binding my objects which contains sub objects to the control.i.e. with simple object i just do ddl.DataValueField = "myproperty" with my objects they contains sub objects which i want to bind. I have tried ddl.DataValueField = "sub-object.myproperty" which doesnt work.
firstly a static class only ever exists once and is not an instance. Any static members (ie static int NoOfPeople;) is stored in one place and is shared between all sessions (like the old global variables). Now static methods is where i'm not 100% sure. If I have a static method that doesn't use any other static members could this cause inconstant results, example (this is a fairly pointless method but just a quick example of the top of my head)
[Code]....
So in this example if two sessions (or threads) were to call this at the same time - would they both get back the expected results, because the method only uses private data (a, b and totalToReturn).Im sure this sounds a little simple but I will be using static methods to build user objects and various other objects that there will have to be a 100% garentee that the objects will not get mixed up between sessions and the wrong things return to the user.
I'm working on a project in which we have a database, data layer (entity framework), business layer and web/UI layer.I want to use ASP.NET Dynamic Data for the web layer, but don't want it to access the data layer or database, as I want it to be purely running off business logic, and not directly accessing the data.However, it appears that Dynamic Data only allows Linq-to-SQL or entity framework data sources to be used.Has anyone used it with business-layer objects instead?
Lets say I am doing a shoping cart. I authenticate the user with a session variable.For example:
If(Request.IsAuthenticated) // Here I want to add to the shoping cart. // Can I do the following Session["Cart"] = "Washing Machine"; Now will this Session["Cart"] value which is washing machine here be unique to diff customers?
I am very new to ASP.NET, and I understand this is very nooby, but I can't figure it out myself!
I'm trying to align objects on my master page. What I mean is I have the header banner, the footer banner, and a navigation menu in the middle. Now between the navigation menu bar and the footer banner, I have a shoutbox. I want to align this shoutbox to the right side of the page, so that it is even with the edge of the navigation menu bar and footer. The width of those is 1100px. I'm using visual studio 2008.
Currently i am having a list like List<Tickets> allTickets.I need to select in the same list some corresponding info about the ticket writer like List<Ticket, aspnet_User>.
where the data param is an array of name/value pairs. To prepare my values for that data param I need to combine the properties of a strongly typed class with the values of a simple 2d array.
What is the best practice on disposing objects in a .net method? I tend to avoid try/catch blocks as much as possible, so lets say I have a method in vb.net code behind that instantiates an object (The object may be a local variable or a class variable).Should I call objectName.dispose() when I am done with it?I am keeping in mind that I should aquire the object late and release it early during that method execution.
Private Sub Entity_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init im db As New LinqDataAccess.QuantumDataContext Dim result = db.GetAddressType("Company") [code]...
I have a 50 x 50 image button layout. That's 2,500 image buttons. I want to assign each imagebutton a picture depending on what is in the database. Will this be too much to do? Is there a faster way?
I have a list of objects (List1) and I am trying to make a copy of this list (List2) and then change one of the fields in the new list.I used :
List<MyObj> List2 = new List<MyObj>(); List2.AddRange(List1); I alos tried: List<MyObj> List2 = new List<MyObj>(List1); But regardless of the method, when I do: foreach (MyObj o in List2) o.some_field = 2
it not only changes the field in Lis2 but alos in List1. Not sure what I am missing here.
I have Categoreis and Locations I would like return both in one method. How can make a use of both Categories.ToList() and Locations.ToList()? What type of object should I return?
In ASP.NET I have a form that has a Textbox named txtOutput and a button. In the main file.aspx.vb I can call a function from the button handler and in that function I can have
txtOutput.Text = "Some Message"
with no problem. I have a bunch of functions in several other classes. For instance I have a class named AbleCommerce that does some database functions. These functions are called from my main class. In those functions, however, I have no visibility of txtOutput. All of my classes are, unfortunately, in the default namespace which I understand is not optimal but didn't seem to impact this issue.
I know this is an easy one I've just not understood properly but it has me stumped. My gut says that I probably need to pass the Textbox object to my "other class" but can't for the life of me figure how.
I have an existing web application that uses EF and POCO objects. I want to improve the client experience by exposing some of my objects through WCF(JSON). I have this working fine but where I am unsure is how to handle derived objects(not sure if that is the correct term) or IEnumerable anonymous objects if you will.
Let's say I have 3 tables structured like so:
Templates
ID Template
Groups
ID Group
Instances
ID TemplateID GroupID
This is obviously a one-to-many type relationship. I have my navigation properties setup correctly and getting strongly typed object properties works great. However, how do I send serialized anonymous type object(s) over the wire. Like an object that sends all instances that are equal to groupid=1 and include the names of the template and the object.Am I missing something or do I have to create another class object for WCF that would look like this:
I guess I could alter my tables to account for this but that seems wrong too. I know that IEnumerable objects can't be serialized and I know that throw away objects are probably not the way to go either. I want to do this the right way but I am not sure how to go about it.