dot net tips, DotNet tips, .Net Tips,Dot Net tips and tricks,Dot Net Solutions, OOPS Concept in C#,SQL Server, LinQ, Ajax, Java script, JQuery, Server Error details, daily .net tips and tricks , DotNet Interview Questions.
how to identify the sql server edition
select serverproperty('edition')
The result will look something like:
32-bit: Enterprise Edition
64-bit: Developer Edition (64-bit)
Determine Size of a Table in SQL Server
sp_spaceused ‘Tablename’How to read child nodes from specific xml file
you need to use here is theXLINQ. After adding the reference to System.Xml.Linq
in your program do write the below code.
XElement companyInfo = XElement.Parse( @"<COMPANYINFO> <CORPORATE ID=""C45RT4C"" NAME=""NEW COMPANY LTD.""> <LOCATION ID=""P88972FC"" NAME=""EASIER""> <SUBLOCATION ID=""S89872FE"" NAME=""400462""/> </LOCATION> <LOCATION ID=""PDRD2905"" NAME=""XT-454560-5""> <SUBLOCATION ID=""SFDF22D7"" NAME=""202743""/> <SUBLOCATION ID=""S106B993E"" NAME=""401048""/> <SUBLOCATION ID=""SDEA2907"" NAME=""507152""/> <SUBLOCATION ID=""123C699"" NAME=""507180""/> <SUBLOCATION ID=""HTY4C896"" NAME=""507205""/> <SUBLOCATION ID=""SFD580DD"" NAME=""600281""/> </LOCATION> <LOCATION ID=""PD1104ED"" NAME=""TD-454560-4""> <SUBLOCATION ID=""211704EF"" NAME=""202724""/> <SUBLOCATION ID=""SFD37943"" NAME=""401056""/> <SUBLOCATION ID=""XDEA2A2D"" NAME=""507169""/> </LOCATION> </CORPORATE> </COMPANYINFO>"); foreach (XElement subLocation in companyInfo.Elements("CORPORATE").Elements("LOCATION").Elements("SUBLOCATION")) { Console.WriteLine(subLocation.Attribute("NAME").Value); }
If condition in Repeater,Listview
while binding data in repeater i need to do a if condition in the same repeater, so i use below one.
<ItemTemplate>
<table>
<div id="Div1" runat="server" visible='<%#Eval("TextA") !="" %>'> // true or false
<tr>
<td style="width:120px;">
<asp:TextBox ID="TextBox1" Text='<%#Eval("AnimalGroup") %>' Width="100" runat="server"></asp:TextBox>
</td>
<td style="width:100px;">
<asp:TextBox ID="txtQno" Text='<%#Eval("QNO") %>' Width="100" runat="server"></asp:TextBox>
</td>
<td style="width:500px;">
<asp:TextBox ID="txtTextA" Text='<%#Eval("TextA") %>' Width="500" runat="server"></asp:TextBox>
</td>
</tr></div>
</table>
</ItemTemplate>
Its working fine..... Thanks