|
I have the following signature for my Insert on a custom class:
public iCustomException Insert(Person Person)
{
iCustomException oCE = null;
CommitOutcome oCO = Person.Commit(Person.Current_Src_UID, Person.Current_Src_ID, ref oCE);
return oCE;
}
My question is there a way to retrieve the return value of this function call through the ObjectDataSOurce either by Parameters or some other way? The returned object is a class that derives from Exception and tells me if there was an error during the call and what the specifics are about the error.
Any help is greatly appreciated
Regards, Santiago "Saint" Perez Florida's Turnpike Enterprise - Santiago.perez@dot.state.fl.us
|
|
|
|
|
I haven't actually tried it, but I am pretty sure you can add a Parameter to the InsertMethod and then just set the Direction to returnvalue. The only thing I am not sure about is if it will allow your custom type. Normally, you are forced to use simple types.
Hope that helps.
Ben
|
|
|
|
|
I am using C# and wish to create a project on VS 2005 and using the framework of .net 1.0 please help
samuel
|
|
|
|
|
You can't. To target .NET Framework 1.0, you must use Visual Studio .NET 2002 or the .NET Framework 1.0 SDK (using the command-line csc compiler).
VS2005 can only target .NET Framework 2.0, .NET Compact Framework 1.0 (if the desktop .NET Framework 1.1 is installed) and .NET Compact Framework 2.0.
|
|
|
|
|
Please don't cross post.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
You can't like Mike said. If you develop a project on VS2005, then anyone using it would have to be running .Net 2.0 which is better than 1.0 anyways.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
You can use MSBEE to target 1.1 on Visual Studio 2005:
http://www.google.co.uk/search?hl=en&q=msbee&meta=[^]
BUT this will not change the intellisense or any of the other handy things in the IDE from 2.0 1.1 so you'll have to know from memory what you can and cannot use.
You should use 2.0 anyway ... it has some extreamly useful new stuff in it.
|
|
|
|
|
How many copies of the Common Language Runtime (CLR) can be executing on a machine at one time?
I think there is only one image of the CLR running on a machine. It will try to load mscoree.dll into memmory only only if it is not there. it is not in a per application basis. am i right ???
|
|
|
|
|
The CLR is loaded once per process, normally, as the Windows Process is the primary runtime host. However, it may be loaded fewer or more times in someone's custom build runtime host.
|
|
|
|
|
An unlimited number, or one, depending on what you're talking about.
There can be multiple versions of the .NET Framework CLR installed on a computer. There is however only one copy of mscoree.dll (per processor architecture), which is installed in the Windows System32 folder (on a 64-bit system, the 32-bit x86 version is in SysWOW64). This is really a stub responsible for loading the correct version of the real runtime (either mscorwks.dll or, for server GC on .NET 1.x, mscorsvr.dll).
Each process can only have one version of the CLR loaded (right now, this is 1.0.3705, 1.1.4322, or 2.0.50727). The first version requested is the only one ever loaded in that process. Unless otherwise guided by an application config file, .NET DLLs loaded via COM Interop will cause the latest version of the CLR installed on the system to be loaded into that process. 64-bit processes can only load v2.0 of the CLR because .NET 1.x doesn't support 64-bit.
Now we get into how Windows loads code and (initialised) data from program binaries (EXEs and DLLs). It actually loads them as shared (memory-mapped files) - the code and data are initially only in physical memory once. It also loads them on-demand - only when actually referenced, so loading a 5MB DLL doesn't immediately consume 5MB of physical memory. Writeable data pages are marked copy-on-write - they start out sharing the same data, but as soon as the process tries to write to the page, the OS makes a copy of it.
Read-only and unchanged copy-on-write pages can be re-read from the original file, so when trying to free up physical memory, Windows can simply discard the page, rather than having to write it out to the page file. The page is said to be backed by the original file. Pages that have been written to, and dynamically-allocated pages, are backed by the page file.
DLLs (and EXEs) have a base address. This is the virtual memory address, in the process's address space, that it would like to load at. Being the first thing to be loaded, the EXE always loads at its base address, but DLLs might have to be moved - relocated - elsewhere if there's something else already at that address (whether another DLL or some other allocation). Some native processor instructions only work with absolute addresses, which are written into the program code and data. When relocating a DLL, the OS has to change these addresses, so it copies the original page to a new page (backed by the page file) and modifies that.
So ideally, there's only one copy of read-only code and data from any EXE or DLL in physical memory at any one time, but there might be more if a DLL had to be relocated.
That's how it works for EXEs and DLLs containing native code. For managed, .NET code, Windows still loads the EXEs and DLLs as above, but the CLR must compile the IL code contained in the file into native code that the processor can actually execute. It does this by allocating memory in the process's address space which is unique to that process. Each process has its own copy of JIT-compiled code.
This would normally result in a lot of duplicated pages, hence physical memory overhead, so the Framework has the ability to pre-JIT compile whole assemblies and store them as native code on the disk, using the ngen program. It then loads these as regular native code DLLs, allowing Windows to do its normal sharing of these DLLs' pages between processes, as well as saving time since the JIT compiler step is not required. Large parts of the Framework are pre-JITted in this way. You can see the list (of 32-bit native assemblies generated by .NET 2.0) by going to Windows\Assembly\NativeImages_v2.0.50727_32 in a command prompt and getting a directory listing.
When it has loaded a native image, or JITted the code, the Framework still needs the original assembly for a few things (like Reflection and JITting other methods which refer to the assembly), but in general the original pages containing IL are not referenced that often, so Windows will eventually discard them.
|
|
|
|
|
very interesting summary. I would like to be able to vote 6 or more.
Even though, just maybe, the OP expected a more concise yes or no.
Regards
|
|
|
|
|
Thanks Mike, Thanks a lot for that elaborated reply which helped me to clear my doubt. and i've voted 5
|
|
|
|
|
i need to create a setup file for a database project in vb.net that will create a database and also install a server when the setup file will be installed.and that program will be run in any other computer which have no vb.net or sql server.
that means sql server and .net framework and database will be installed by the setup file execution like any other software.
please help me.
|
|
|
|
|
Have you done a search for articles here on CP? If I recall, there may be one or two...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hello all
Does anyone know how to produce a windows form with no title bar that is
resizeable but also shows text on the taskbar button.
I can get what I need by creating the form, making the border sizeable,
removing the control box and removing anything from the 'Text' property.
Only problem then is that the button on the taskbar shows no text either,
just an icon and I need it to show text and the icon (as a normal form
would)
|
|
|
|
|
Cant be done:
the form shows the title unless it is an empty string;
the taskbar shows the form's title.
taskbar shows title ==> form shows title.
|
|
|
|
|
Luc Pattyn wrote: Cant be done
Well, unless he wants to write his own complete OS that handles such a thing, but who would want to use it. Kind of defeats the purpose...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
yes can be done.
Make FormBorderStyle to None and write customized form resizing code. now you can display Form text in Task bar as well.
Regards
Kaleem
|
|
|
|
|
Good for you, sounds like you solved it
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Just wanted to close the second circle around.
|
|
|
|
|
Hi
I have built a datagrid which should populate a set of images whose urls are stored in my database, and set each of the images in my datagrid to there corresponding addresses
I have a simple databind method which binds a dataset from a select query into my datagrid
But i am not sure how to access the image address return values, so that I can populate the values thru my datagrid.
here is my code this far
any help much appreciated
Cheers
Boyindie
<code> <asp:DataGrid runat=server ID=dgImage AllowPaging="True" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None" Height="73px" Width="385px" DataKeyField="imageId">
<Columns>
<asp:BoundColumn DataField=imageId HeaderText="Image ID" ></asp:BoundColumn>
<asp:TemplateColumn HeaderText=Products >
<ItemTemplate ><asp:Image runat=server ID=imageHolder ImageUrl="~/test/<%imagetable %>" />
</ItemTemplate>
</asp:TemplateColumn>
<asp:ButtonColumn HeaderText="View item" CommandName=getDetails ButtonType=PushButton Text=Select></asp:ButtonColumn>
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditItemStyle BackColor="#2461BF" />
<SelectedItemStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<AlternatingItemStyle BackColor="White" BorderColor="#0000C0" />
<ItemStyle BackColor="#EFF3FB" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
</asp:DataGrid></code>
<code>'Builds .net mysql connection and passes connection string into method
Dim connection As New MySqlConnection(connectionString)
'Open connection to DB
connection.Open()
'Create mySql command string for passing query or SPROC(Stored Procedure)
Dim cmdString As New MySqlCommand
'Set Command to equal mySql connection, so can pass SQL query
cmdString.Connection = connection
'Set command string to equal SPROC
cmdString.CommandText = "sp_image"
'ONLY PLACE THIS IF SPROC, sets the command to a SPROC
cmdString.CommandType = CommandType.StoredProcedure
'Create dataAdaptor for passing data between .net and mySQL
Dim dataAdaptor As New MySqlDataAdapter
'Sets command object to datAdaptor
dataAdaptor.SelectCommand = cmdString
'Creates a dataset which will be filled with data from
'dataAdaptor
Dim ds As New DataSet
dataAdaptor.Fill(ds)
'Creates Table which is filled data from dataset
Dim dataTable As New DataTable
dataTable = ds.Tables(0)
'Sets datagrids source to datatable
dgImage.DataSource = dataTable
'binds ds to datgrid
dgImage.DataBind()</code>
|
|
|
|
|
Hello everyone ,
I have an application which I want analysing its performances.
CPU time, memory...
there are tools like Vtune...but I have to use .net performance tools or libraries.
But i do not have any idea about them
Someone can help me?
Thanks.
assia
hgfh
|
|
|
|
|
You can use the PerformanceCounter class which ties into the Performance Counter in the Administrative Tools section of Control Panel. You can pull down many different performance metrics with this class...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Ok thanks Paul
hgfh
|
|
|
|
|
You are very welcome, and I think there is an article or two here on Code Project about using the PerformanceCounter class.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|