.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Under the Hood: Link-time Code Generation

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

More Related Resource Links

Can this code be setup to run against the whole database instead of just 1 record at a time?


We have made some changes to this code to start capturing 1 new field of data and updating it as new records are added. But there is currently about 120,000 records more or less.. those records of course dont have the new field populated with anything..

We would like to run this logic that already in place and run it against the tables to update the fields 1 time. I think to make it easier, if it can be setup to expect the "valueTwo" variable, so that we can run it againt the individual codes instead of doing all the records at one time.. there are codes that only have a few records, so it would be best to test initially against the small code group.


            strSqual = "insert into trans (trans_type_name, trans_date,sys_id,mod_user_id,show_ind, remoteCode, techName) values('" & valueTwo & "','" & TransDate & "',"&strSystemID&", 1,'T', '" & dbQuote(strUser) & "', '" & strTechName & "')"        
            'get the new transaction_id out for just inserted alarm   
            strSqual = "select max(transaction_id) as transaction_id from trans"  
            set rst = getStaticRecordSet(strSqual)

Generation Test: Automated Unit Tests for Legacy Code with Pex


Creating and maintaining a unit test suite for legacy code can be a challenge. Pex automatically produces a small test suite with high code and assertion coverage.

Nikhil Sachdeva

MSDN Magazine December 2009

Toolbox: Code Generation, A Charting Component, and More


Developers have a number of tools at their disposal, but which of these components do you really need to complete your project? Each month we'll analyze the latest software and books to see if they merit inclusion in your toolbox.

Scott Mitchell

MSDN Magazine January 2006

XML Comments: Document Your Code in No Time At All with Macros in Visual Studio


Starting in Visual Studio 2005, XML documentation support will become available in Visual Basic and C++ as it has been for C#. However, making full use of the many comment tags will take a little extra work In this article, the author shows how Visual Studio macros can be used to automate the creation of XML documentation and creates macros that write large sections of comments with just a keystroke.

Tony Chow

MSDN Magazine July 2005

Code Name Longhorn: A First Look at Writing and Deploying Apps in the Next Generation of Windows


The next version of the Microsoft Windows operating system, code-named "Longhorn," marks a significant change not only in terms of how the operating system works, but also in the way in which applications are built. The Longhorn version of Windows includes a new storage system, natural search technology, and an increased emphasis on security and trustworthy computing. Here the author provides an overview of Longhorn, focusing on the build-once, deploy n-times application model. In addition, he discusses the new language, code-named "XAML," that's used to create UI elements, then presents some working samples.

Dino Esposito

MSDN Magazine January 2004

XSLT: Simplify Development and Maintenance of Microsoft .NET Projects with Code Generation Technique


Code generation techniques using technologies such as XSLT are playing an increasingly important part in software projects as they support the development of a rapidly maintainable code base. This article discusses some of the benefits and possible applications of code generation.To demonstrate these techniques the author develops a Web Forms application that supports the maintenance of records in a SQL Server database, using the database's own metadata to drive the generation process. The SQL Server database schema is extracted using SQLXML 3.0 data access and processed through XSLT stylesheets that generate both a database access layer and a Web Forms user interface with query and update pages.

Peter Ashley

MSDN Magazine August 2003

Automatically Execute Code at certain time from website


Is there a way to trigger a piece of code to execute at a certain time once a week?

I basically want my website to send out a reminder email every sunday. I have a function called SendReminder() and I would like to know if it is posible for it to run by itself because at the minute I have to press a button to run it.


data contract code generation for large/complex schema (HR-XML/OAGIS) - is there an alternative?

Hello, and thank you for reading.I am implementing a Service based on a predefined specification (HR-XML 3.0). As such, I am starting with the schema, and working my way back to code. There are a number of large Schema documents (which import yet more Schema documents) related to my implementation, provided by this specification.I am able to generate code using xsd.exe, by supplying the "main" and "supporting" xsd files as arguments. But there are several issues, and I am wondering if this is the right approach.- there are litterally hundreds of classes - the code file is half a meg in size- duplicate classes (ex. Type, Type1 - which both represent the same type)- there are classes declared as inheriting from a base class, but that base class is not generated/definedI understand that there are limitations to the types of Schema supported by svcutil.exe/xsd.exe when targeting the DataContractSerializer and even XmlSerializer. My question is two-fold:1. Are code generation "issues" fairly common when dealing with larger, modular xsd files? Has anyone had success with generating data contracts from OAGIS or HR-XML schema?2. Given the above issues, are there better approaches to this task, avoiding generating code and working with concrete objects? Does it make better sence to read and compose a SOAP message directly, while sti

auto code generation

Dear All,What are possibilities of automatic code generation using C# and Visual studio 2008?All I know is that there are 3rd party tools like Infragistics and IronSpeed that do this kind of stuff.I don't know if there are any means by which we can do the same i.e generate classes, methods without having to write the code in VS.Has anybody done something like this?If so pls let me know what and how?Thanks.

WCF client code Generation

Hi, I am new to WCF programming. I am confused in creating client code. Will it be created automatically when I add Service Reference or I will have to create it using Svcutil.exe or Both things: I will have to add service reference and then create client code using Svcutil.exe Kindly confirm.Amit Lohakare

Service is executing code after time out.

Hi All,  I am using IsOne way and nettcp binding in mu WCF. [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,ConcurrencyMode=ConcurrencyMode.Multiple)]   public class FlexiAsyncServer : IAsyncInterface   {       public void OneWayRequest()         {              for (int i = 0; i <= 5000; i++)                 {                     DbCommand cmd = dbAsync.GetSqlStringCommand("insert into  JOB_DEFNN (JOB_NM,JOB_STAT_CATG_ID,JOB_GRP_ID) values('"+i.ToString()+"',1,101)");                     dbAsync.ExecuteNonQuery(cmd);                 }           } } In Service side before inserting this 5000 records into database i am getting time out error in client side. But though i got error the records are being inserted until it complets 5000. My question is why the service side execution is not stopping a

KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdbdf Exception code: 0xe0434f4d Fault off


Hi all just am getting this error with KernelBase.dll, what's happening at my application end is that I am using .NET Framework to determine if network connectivity is available, raise an event from underlying dll to inform application when network connectivity is established, or network connectivity is unavailable. Nothing really special here just using standard stuff out of .Net framework here.  Have seen similar incidents with KERNELBASE.dll reported, but no one is really giving out any info on what exception 0xe0434f4d is a code for.  Knowing what the execption would be, would allow me to find a quick workaround to the problem. BizTalk seems to have similar issue with KERNELBASE.dll. 


Additional info that may help is that I am running the .NET application on a Windows 7 machine with less than 100MB of storage space, well below the recommended minimum of 300mb, but am testing the .NET application through it's paces now. It should work if Windows 7 is working.

Below is the extract taken from the Windows application log:-


Running Subreport and link to report ahead of time.



I have a question regarding running subreports ahead of time to ensure long running report does not take over 1 hour.

Problem Statment:

I have a top report subscription (Dashboard) that runs daily. In the top report, I have links to sub report that based its parameter to the top report row. The problem is the sub reports takes 20-30 minutes to run. How can pre run the sub reports once the top report has run, so that I do not have to wait 20-30 minutes to drill in to those sub report ?




Link/Connect SQL CE Table to Access MDB for VBA Code Processing

I'm hoping to connect an SQL CE file (main.dat) to an Access DB so I can run some vba code which:

1. Uses DAO to open a recordset (a table in the SQL CE DB)
2. Uses a field containing paths to mp3 files to extract the id3 tag data
3. Update an existing field from the same table/Same SQL CE DB

I've looked around and can't seem to find any ODBC driver(s) for SQL CE.  Got some info from Erik who suggested I post here.

Thanks in advance!

EDIT:  I just now was able to get Erik's code to work in Excel from my DB.  But I'm not sure how to send it back to the SQL CE DB from VBA... Is it possible?

Infopath form timesheet question on rounding time and using code


We have a timesheet form that has 4 time fields:  Start Time, End Time, Actual Time and Billable Time. 

Our Start Time, End Time and Actual Time buttons and field calculations work just fine, but we want the 4th field to calculate the billable time by rounding UP to the quarter-hour.

For example:

Start Time - 9:00am

End Time - 11:20am

Actual Time -  2:20

Billable Time - 2:30 (or 2h30min)


I'm new to Infopath and not sure how we would accomplish this.  What type of code would I need and can I even use code on that Billable Time field to accomplish this?


Thanks for any help you can give me!


SQL Server 2008 query execution time is different if i execute it in management studio or from code

When I execute query from software which i wrote in c# it required lots of time to complete but if I execute exactly the same query from management studio it will be done in seconds. In both cases execution plan is the same. 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend