Friday, July 31, 2009

SilverLight Interview Questions

What are the types of containers in silver light?
dock panel-dock panel is used to arrange a set of objects around the edges of panel. Dock Panel’s Dock property enables you to specify the location of objects inside Dock Panel. If you set the LastChild Fill property to true (the default value) and the last element is allowed to resize, the last element added to the panel will resize to fill the remaining space. If the last element is set to a specific size, the last element will be set to the specified size and positioned in the middle of the remaining space. The order in which elements are added to the dock panel is important.
Wrap Panel-Wrap panel is used to wrap the content in the next line.

What is silverlight .js file?
silverlight.js is a helper file is used when adding a silverlight application to a web page via javascript .It contains more helper method like get silverlight,ongetsilverlight,etc.We can add silverlight application to a web page by an alternate way asusing objecttag in html element

Does Silverlight support ADO.NET? and How to load the data to Silverlight from database?
It Does not support ado.net .have to use via WCF service,

How to use the styles in Silverlight? Can we load the external CSS file into Silverlight?
NO, it is not possibel to load external css in silverlight.We can use setter property to in app.xaml to apply the style.
For ex:
In app.xaml
style x:Key="titleBorder" TargetType="Border"
setter property="Background" value="#ff0000"
Style
if we r using brush then use Setter.value under setter.property
To use in the page
border style="{staticresource TitleBorder}>
textBlock text="GetData" style="{staticresource titleborder}"
border

can we use more than one xaml file in same project? explain?
yes we can use.To redirect from one xaml to other xaml
App app = (App)Application.Current;
app.UserName = txtUser.Text;
App.GoToPage(new Page2());

public static void GoToPage(UserControl nextPg)
{
App app = (App)Application.Current;
// Remove the displayed page
app.mainUI.Children.Clear();
// Show the next page
app.mainUI.Children.Add(nextPg);
}
to pass the parameter u can created property class and assign the value before passing parameter



Monday, June 22, 2009

Reset Identity column value in sql

Syntax:
DBCC CHECKIDENT
( 'table'
[ , { NORESEED | { RESEED [ , new_reseed_value ] } } ]
) [WITH NO_INFOMSGS]

Key:
NORESEED - The current identity value should not be changed.
RESEED - Change the identity value.
new_reseed_value - The new seed value to be used for the identity column.
WITH NO_INFOMSGS - Suppresses all information messages.

DBCC CHECKIDENT ('Employee', RESEED, 0)

Friday, June 19, 2009

Update Dynamic Values in App.Config

Hi,
Here is the code to update the dynamic values in app.config


Wednesday, June 17, 2009

Day Pilot Calendar Div problem in IE7 Browsers

Day Pilot Calendar Div problem in IE7 Browsers


Calendar does not set in the IE7 Where as It Works fine in Firefox. In Ie7 It get blocked. it ruins the whole day and at last i found the solution by


Set the parent div to position: relative

Read Me and License Agreement While Creating Window Setup

Here is the instruction to add readme and license agreement while creating Windows Setup:

1) Select File->New->Project.

2) In the project panes, select Setup and deployment projects. In the templates pane, select setup project.

3) Select File->Add project->Existing Project. And add your project

4) Select the "File System on Target Machine" in the File system editor.

5) To add the output, select View->Custom ActionàAdd Custom Action->project output. Select "Project" from the drop down-list. Select primary output from the output list.

6) Click the ok button.

7) To create a shortcut on the desktop, in the details pane select primary output from sample. Select action->create shortcut to primary output. Change the shortcut name. Drag the shortcut to the user's Desktop node in the left pane.

8) Right Click on the User Desktop Select Properties Window and Change the Condition Property to SHORTCUTDEMO

9) To add Read Me and License file follow the procedure

10) Create ReadMe.Rtf File and License.Rtf File and add it in the application folder in the file system editor Note: If the Content is not displayed in read me and license then there is a problem in rtf format file.

11) Select View à User Interface Editor and right click on start under install category and click Add Dialog menu.

12) In the Add Dialog box, select the Checkboxes (A), License Agreement, Read Me, and Splash dialog boxes, and then add them to the Start sequence.

13) Drag and drop the dialog boxes into the proper sequence


14) Select the License Agreement dialog box and view its properties window. Change the License File property to license.rtf.

15) Select the Read Me dialog box and select View | Properties Window to bring up its properties window. Change the Readme File property to readme.rtf.

16) To have the developer.com logo display on all of these additional default dialogs, set the Banner Bitmap property to developer.gif.

17) Use the Checkboxes (A) dialog box to ask the user whether the demo shortcut you placed in the User's Desktop folder should be installed or not. Modify the properties of this dialog box to match the Figure 5 screenshot.

18) Remember to set the CheckBox1Property to SHORTCUTDEMO. This value is the same as the Condition property that you set for the User's Desktop folder in the File System Editor. If the user selects this checkbox during installation, the value of the SHORTCUTDEMO condition is set to true. As a result, the shortcut installs on the user's desktop. If the user does not select this checkbox, the SHORTCUTDEMO condition is set to false and the shortcut does not install.

Wednesday, May 20, 2009

SqlQuery To Export Data from Excel to Sql

Hi,
Here is the query to export the data from Excel to sqlserver

CREATE TABLE [dbo].[Addresses_Temp] (
[FirstName] VARCHAR(20),
[LastName] VARCHAR(20),
[Address] VARCHAR(50),
[City] VARCHAR(30),
[State] VARCHAR(2),
[ZIP] VARCHAR(10)
)
GO

INSERT INTO [dbo].[Address_Temp] ( [FirstName], [LastName], [Address], [City], [State], [ZIP] )
SELECT [FirstName], [LastName], [Address], [City], [State], [ZIP]
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\Source\Addresses.xls;IMEX=1',
'SELECT * FROM [Sheet1$]')

To Access the function such as OPENROWSET Go to
MicroSoftSqlServer2005--->ConfigurationTools--->
SqlSurfaceAreaConfiguration

Click on Surface Area Configuration For features
and Enable OPENROWSET and OPENDATASOURCE support

Sunday, May 10, 2009

WildCharacters in Sql

Hi,
Here are the query results using Wild card Character.Consider below table
Student:

Now Consider the Query

Select * from student Where Name like ‘John%’.

It return results as name starts with john . You will get the result as



Select * from student Where Name like ‘%John’. It results as



Select * from student Where Name like ‘%John%’. It results as



Select * from student Where Class like ‘Fo_r’. '_' matches single character and replace it