Tuesday, March 8, 2011

jquery add event

i added a control using string in javascript

eg:- var divbtnsend = "gtr input id="" + id + "" type="button" value="Send" ";

Now i needed to bind a click event ...

  $("input:button").live('click', function () {
            saveMessage(this.id);
        });

subquery in linq


from m in Messages
where m.RoomID == Convert.ToInt32("1") && ((m.ToUserID == 2 && m.ToUserID != null) || (m.UserID == 2 && m.ToUserID != null)) && m.TimeStamp > Convert.ToDateTime("03/06/2011").AddMilliseconds(999.00)
orderby m.TimeStamp, m.UserID, m.ToUserID
select new { m.Text,m.UserID,m.ToUserID,m.TimeStamp,
fromusername = Users.Where(u => u.UserID == m.UserID).Single().Username,
tousername = Users.Where(u=> m.ToUserID == u.UserID).Single().Username
}

Monday, February 7, 2011

dotnet interview questions


OOPS
------------------------------

what is pure abstract class?
whta is simple abstract class
wht is an interface
can we inherit a class in an interface
static class
do static class has an constructor
when do they sit in memory
wht is virtual class

Framework
---------------------------------

what is difference between idisposable and finalizer
what is garbage collection
what is diference between value type and refenrece type
wht is heap and stack memory
wht is boxing and unboxing
pls explain string x ="123"; wht happens in memory
how memory is managed
what is manged code and unmamaged code
hashtable and idictionary
appdomain
wht are generics
wht is the diferene between arraylist and array
how to copy one object into another
using keyword
wht is difference between ref and out
wht is diff between runtime and compile time
wht is searching - in depth search, shallow search

asp.net
------------------------------------
wht is diff between get and post
what happens when i write http://localhost/appname/pagename.aspx
wht is the role of viewstate
wht actually is stored in viewstate
when is ispostback property set in asp.net
on which event and in which class the ispostback property set

sql server
--------------------------------------
wht is referential integrity
wht are stored procedures
wht is indexing
wht is the difference between clustered and non clustered indexes
how are queries in sql complied
is there any other type of indexes
wht is difference between left outer join and left join
deadlock
replication
--------------------------------------


features in asp.net 3.5
what is charm of having web.config file?
why we use global.asax?
what is the main benifits of generic classses
how can we update web.config without down the site
can we have try catch within a try-catch
can we write try without catch
can we write finally
how many finnally we can have
can we have try-finally block
can we have try-catch-catch
if we have try-try-catch is it feasible
form authentication
role based security
caching
fragment caching
what is generics
what is garbage collector
cookieless sessions
heap and stack memory
how can we store variables in client side
wht are session side magements
wht is the cocept of partial clasess
wht is inheritence
wht is static keworrd
wht is static constructor
how in memory static variables stored
abstract classes
visual source safing

CTE
indexes
when shd we use indexes
transactions
triggers
how to complie stored procedures
what is the use of network wali koi command thi
how can we next transactions
difference between stored procedure and inline query

Thursday, January 6, 2011

LINQ Resources

http://www.codeproject.com/KB/linq/CRUDLINQ.aspx

Saturday, December 18, 2010

CalendarExtender and getting the correct date format or change UI Culture of CalenderExtender

Change  ui culture of calendarextender or apply UI Culture on CalenderExtender of Ajax Control toolkit.

 Firstly, add Culture and UI Culture information to your web.config file.

<system.web>
    <globalization uiCulture="en" culture="en-GB" />
system.web>
 
Sett the EnableScriptGlobalization and EnableScriptLocalization to true as properties of the ScriptManager.

<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"
    EnablePartialRendering="true"
    EnableScriptGlobalization="true"
    EnableScriptLocalization="true">
cc1:ToolkitScriptManager>

Friday, November 19, 2010

asp.net css on gridview paging

In RowDatabound Event

if (e.Row.RowType == DataControlRowType.Pager)
        {
            TableRow tRow = e.Row.Controls[0].Controls[0].

            Controls[0] as TableRow;


            foreach (TableCell tCell in tRow.Cells)
            {


                Control ctrl = tCell.Controls[0];

                tCell.Attributes.Add("align", "center");
                if (ctrl is LinkButton)
                {


                    LinkButton lb = (LinkButton)ctrl;


                    lb.Width = Unit.Pixel(20);

                    //lb.Attributes.Add("");

                    lb.BackColor = System.Drawing.Color.DarkGray;


                    lb.ForeColor = System.Drawing.Color.White;


                    lb.Attributes.Add("onmouseover",


                       "this.style.backgroundColor='#4f6b72';");


                    lb.Attributes.Add("onmouseout",


                      "this.style.backgroundColor='darkgray';");


                }


            }



        }

Friday, September 3, 2010

Difference between int32,tryparse and convert.toint32


Int32.parse(string)
-------------------------
Int32.Parse (string s) method converts the string representation of a number to its 32-bit signed integer equivalent.
When s is null reference, it will throw ArgumentNullException.
If s is other than integer value, it will throw FormatException.
When s represents a number less than MinValue or greater than MaxValue, it will throw OverflowException.

Example:
------------------
string s1 = "1234";
string s2 = "1234.65";
string s3 = null;
string s4 = "123456789123456789123456789123456789123456789";

int result;
bool success;

result = Int32.Parse(s1); //-- 1234
result = Int32.Parse(s2); //-- FormatException
result = Int32.Parse(s3); //-- ArgumentNullException
result = Int32.Parse(s4); //-- OverflowException


Convert.ToInt32(string)
----------------------------------
Convert.ToInt32(string s) method converts the specified the string representation of 32-bit signed integer equivalent. This calls in turn Int32.Parse () method.
When s is null reference, it will return 0 rather than throw ArgumentNullException
If s is other than integer value, it will throw FormatException.
When s represents a number less than MinValue or greater than MaxValue, it will throw OverflowException

Example:
result = Convert.ToInt32(s1); //-- 1234
result = Convert.ToInt32(s2); //-- FormatException
result = Convert.ToInt32(s3); //-- 0
result = Convert.ToInt32(s4); //-- OverflowException


Int32.TryParse(string, out int)
---------------------------------------------
Int32.Parse(string, out int) method converts the specified the string representation of 32-bit signed integer equivalent to out variable, and returns true if it parsed successfully, false otherwise. This method is available in C# 2.0
When s is null reference, it will return 0 rather than throw ArgumentNullException.
If s is other than integer value, the out variable will have 0 rather than FormatException.
When s represents a number less than MinValue or greater than MaxValue, the out variable will have 0 rather than OverflowException.

Example:-
-------------
success = Int32.TryParse(s1, out result); //-- success => true; result => 1234
success = Int32.TryParse(s2, out result); //-- success => false; result => 0
success = Int32.TryParse(s3, out result); //-- success => false; result => 0
success = Int32.TryParse(s4, out result); //-- success => false; result => 0

Convert.ToInt32 is better than Int32.Parse, since it return 0 rather than exception. But, again according to the requirement this can be used. TryParse will be best since it handles exception itself always.