Web.config file defines configuration for a web project. Using “AppSetting” section, we can define user-defined values. Example below defined is “Connection String” section, which will be used through out the project for database connection.
<Configuration>
<appSettings>
<add key="ConnectionString" value="server=xyz;pwd=www;database=testing" />
</appSettings>
Sunday, January 9, 2011
What Is The Windows Registry?
The Windows Registry is a directory which stores settings and options for Microsoft Windows operating systems. It contains information and settings for all the hardware, operating system software, most non-operating system software, and per-user settings. If necessary, you can manually edit the registry by doing the following:
1. Hit Start Button
2. Select "Run"
3. Type regedit and then hit the enter key
Any change you make in the registry is saved automatically.
1. Hit Start Button
2. Select "Run"
3. Type regedit and then hit the enter key
Any change you make in the registry is saved automatically.
What are the features are provided by LINQ to fine tuning concurrency at field level?
the features are as follows. One of the best options provided by LINQ concurrency system is control of concurrency behavior at field level. There are three options we can specify using the ‘UpdateCheck’ attribute:- • Never: - Do not use this field while checking concurrency conflicts. • Always: - This option specifies that always use this field to check concurrency conflicts. • WhenChanged :- Only when the member value has changed then use this field to detect concurrency conflicts. Below is the code which show how we can use the ‘UpdateCheck’ attribute to control property / field level concurrency options as specified above. [Column(DbType = "nvarchar(50)",UpdateCheck=UpdateCheck.Never)] public string CustomerCode { set { _CustomerCode = value; } get { return _CustomerCode; } } |
What kind of error reporting options are provided by LINQ when concurrency conflict occurs?
the option are as follows. => ContinueOnConflict :- This option says to the LINQ engine that continue even if there are conflicts and finally return all conflicts at the end of the process. => FailOnFirstConflict :- This option says stop as soon as the first conflict occurs and return all the conflicts at that moment. In other words LINQ engine does not continue ahead executing the code. Both these options can be provided as an input in ‘SubmitChanges’ method using the ‘ConflictMode’ enum. Below is the code of how to specify conflict modes. => objContext.SubmitChanges(ConflictMode.ContinueOnConflict); => objContext.SubmitChanges(ConflictMode.FailOnFirstConflict); |
How can we use XML files to map stored procedures with .NET classes?
n case you have stored procedures in your project you can use ‘Function’ XML element to define your stored procedure name in the XML file. The client code does not change for binding the datacontext and XMLMappingsource object as below.
<?xml version="1.0" encoding="utf-8"?>
<Database Name="TstServer" xmlns="http://schemas.microsoft.com/linqtosql/mapping/2007">
<Table Name="dbo.Customer" Member="WebAppMappingXML.clsCustomer">
<Type Name="WebAppMappingXML.clsCustomer">
<Column Name="CustomerId" Member="CustomerId" />
<Column Name="CustomerName" Member="CustomerName" />
<Column Name="CustomerCode" Member="CustomerCode" />
</Type>
</Table>
<Function Name="dbo.sp_getCustomerCode" Method="getCustomerByCode">
<Parameter Name="CustomerCode" Parameter="" />
<ElementType Name="clsCustomer" />
</Function>
</Database>
<?xml version="1.0" encoding="utf-8"?>
<Database Name="TstServer" xmlns="http://schemas.microsoft.com/linqtosql/mapping/2007">
<Table Name="dbo.Customer" Member="WebAppMappingXML.clsCustomer">
<Type Name="WebAppMappingXML.clsCustomer">
<Column Name="CustomerId" Member="CustomerId" />
<Column Name="CustomerName" Member="CustomerName" />
<Column Name="CustomerCode" Member="CustomerCode" />
</Type>
</Table>
<Function Name="dbo.sp_getCustomerCode" Method="getCustomerByCode">
<Parameter Name="CustomerCode" Parameter="" />
<ElementType Name="clsCustomer" />
</Function>
</Database>
Explain One time binding in silverlight.
-->In one time binding data flows from object to the UI only once.
--> There is no tracking mechanism to update data on either side.
-->One time binding has marked performance improvement as compared to the previous two bindings discussed.
-->This binding is a good choice for reports where the data is loaded only once and viewed.
<TextBox x:Name="txtEnterAge" Text="{Binding Path=Age, Mode=OneTime}" Height="30" Width="150" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBox>
--> There is no tracking mechanism to update data on either side.
-->One time binding has marked performance improvement as compared to the previous two bindings discussed.
-->This binding is a good choice for reports where the data is loaded only once and viewed.
<TextBox x:Name="txtEnterAge" Text="{Binding Path=Age, Mode=OneTime}" Height="30" Width="150" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBox>
What are the different ways provided to do layout in SilverLight?
==>There are three ways provided by Silverlight for layout.
(1) management Canvas
(2) Grid
(3) Stack panel
Each of these methodologies fit in to different situations as per layout needs.
All these layout controls inherit from Panel class.
(1) management Canvas
(2) Grid
(3) Stack panel
Each of these methodologies fit in to different situations as per layout needs.
All these layout controls inherit from Panel class.
Subscribe to:
Posts (Atom)