The C# code is:
Uri uri = new Uri("http://Habeeb.in/pic.jpg", UriKind.Absolute) image1.Source = new BitmapImage(uri);Happy coding....
Uri uri = new Uri("http://Habeeb.in/pic.jpg", UriKind.Absolute) image1.Source = new BitmapImage(uri);Happy coding....
GROUP BY DATEPART(YEAR, SUB.[SubOnDate]), DATEPART(MONTH, SUB.[SubOnDate]), DATEPART(DAY, SUB.[SubOnDate]), DATEPART(HOUR, SUB.[SubOnDate]), DATEPART(MINUTE, SUB.[SubOnDate])
GROUP BY DATEPART(YEAR, SUB.[SubOnDate]), DATEPART(MONTH, SUB.[SubOnDate]), DATEPART(DAY, SUB.[SubOnDate]), DATEPART(HOUR, SUB.[SubOnDate]), (DATEPART(MINUTE, SUB.[SubOnDate]) / 10)
wsdl.exe yourFile.wsdl /l:CS /serverInterfaceNote: You can decide the language of the Interface Class generated. In parameter /l, use VB or CS for your Visual Basic or CSharp respectively. Finally the command will create a new .cs or .vb file.
public class MyWebService : System.Web.Services.WebService, IWsdlService { // Web methods and other calls goes here.... }5) Implement the methods mentioned in the Interface class. Finally your webservice class will be something like this:
public class MyWebService : System.Web.Services.WebService, IWsdlService { [WebMethod] public string MyWeMethod1() { // your business logic goes here... return "MyWeMethod1 Result"; } [WebMethod] public string MyWeMethod2() { // your business logic goes here... return "MyWeMethod2 Result"; }
var mainText = "microsoft"; var isSubstring = mainText.indexOf("soft") > -1 alert(isSubstring);In the example, it checks for the substring "soft" within the main string "microsoft". As it find "soft" inside "microsoft", mainText.indexOf("soft") evaluates to 5 and isSubstring will be true;
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.TypeLoadException: Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′.
start-> Run--> c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -iru
To resolve this issue, run the following command line:aspnet_regiis.exe /iruThe Aspnet_regiis.exe file can be found in one of the following locations:%windir%\Microsoft.NET\Framework\v4.0.30319%windir%\Microsoft.NET\Framework64\v4.0.30319 (on a 64-bit computer)
using System.Data;
DataTable dt = new DataTable(); var result = dt.Compute("5*(4-2)",""); Console.WriteLine(result.ToString());
;WITH x AS ( SELECT col1, col2, col3, rn = ROW_NUMBER() OVER (PARTITION BY col1, col2, col3 ORDER BY id) FROM dbo.tbl ) SELECT col1, col2, col3 FROM x WHERE rn = 1;Duplicate rows
;WITH x AS ( SELECT col1, col2, col3, rn = ROW_NUMBER() OVER (PARTITION BY col1, col2, col3 ORDER BY id) FROM dbo.tbl ) SELECT col1, col2, col3 FROM x WHERE rn > 1;If you want to delete the duplicate rows:
;WITH x AS ( SELECT col1, col2, col3, rn = ROW_NUMBER() OVER (PARTITION BY col1, col2, col3 ORDER BY id) FROM dbo.tbl ) DELETE x WHERE rn > 1;
delete from tbl where id NOT in ( select min(id) from tbl group by sourceid )
// Configure open file dialog box Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); dlg.FileName = "Document"; // Default file name dlg.DefaultExt = ".txt"; // Default file extension dlg.Filter = "Text documents (.txt)|*.txt"; // Filter files by extension // Show open file dialog box Nullable<bool> result = dlg.ShowDialog(); // Process open file dialog box results if (result == true) { // Open document string filename = dlg.FileName; }
Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog(); System.Windows.Controls.PrintDialog dlg = new System.Windows.Controls.PrintDialog();
dRow.Table.Columns["msisdn"] == nullThe row doesn't contain a column property as such. Therefore you will have to get into the Parent table property to check into the columns in the row.
dr["msisdn"] == nullwill throw and error.
dr["msisdn"] == DBNull.Valueand
if(dr.IsNull("msisdn"))are used to check if a column has value
dir %WINDIR%\Microsoft.Net\Framework\v*For a more polished output use the below command.
dir %WINDIR%\Microsoft.Net\Framework\v* /O:-N /B
<httpHandlers> <add verb="*" path="myhandler.api" type="MyAssembly.MyHandlerClass, MyAssembly"/> </httpHandlers>or
<handlers> <add name="MyHandler" verb="*" path="myhandler.api" type="MyAssembly.MyHandlerClass, MyAssembly"/> </handlers>When you navigate to http://myserver/myApp/myhandler.api, if it gives server error 404 Not Found error, it might be the web config settings that might be the issue.
<system.web> <httpHandlers> </httpHandlers> </system.web>example:
<system.web> <httpHandlers> <add verb="*" path="myhandler.api" type="MyAssembly.MyHandlerClass, MyAssembly"/> </httpHandlers> </system.web>2) If your application pool running in Integrated pipelined mode, then the handler reference need to go into the following section:
<system.webServer> <handlers> </handlers> <system.webServer>example:
<system.webServer> <handlers> <add name="MyHandler" verb="*" path="myhandler.api" type="MyAssembly.MyHandlerClass, MyAssembly"/> </handlers> <system.webServer>
<TextBlock Text="{Binding}" TextWrapping="Wrap"/>
<StackPanel HorizontalAlignment="Stretch"> <TextBlock Text="Sample" /> <ListBox Name="MyListBox"> <ListBox.ItemTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Grid Grid.Column="0"> <TextBlock Text="Hello" /> </Grid> <Grid Grid.Column="1"> <TextBlock Text="Hello" /> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </StackPanel>
<StackPanel HorizontalAlignment="Stretch"> <TextBlock Text="Sample" /> <ListBox Name="MyListBox"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch"/> </Style> </ListBox.ItemContainerStyle> <ListBox.ItemTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="8*"/> <ColumnDefinition Width="2*"/> </Grid.ColumnDefinitions> <Grid Grid.Column="0"> <TextBlock Text="Hello" /> </Grid> <Grid Grid.Column="1"> <TextBlock Text="Hello" /> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </StackPanel>
<Style TargetType="ListBoxItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch"/> </Style> </ListBox.ItemContainerStyle>This ensures that the ListBoxItem contents stretches to 100%.
<Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="8*"/> <ColumnDefinition Width="2*"/> </Grid.ColumnDefinitions> <Grid Grid.Column="0">We want the first column to consume 80% of the width of the Grid and second column to occupy 20%.
<configuration ...> <system.web> <compilation ... batch="false"/>
//To Escape: string encodedValue = Uri.EscapeDataString("William&Shakespeare"); NavigationService.Navigate(new Uri("/Page2.xaml?author=" + encodedValue, Urikind.Relative)); //To Unescape: string encodedValue = NavigationContext.QueryString["author"]; string author = Uri.UnescapeDataString(encodedValue);