Category Archives: .net
Store and Retrieve last selected path of FolderBrowserDialog in app.config file
Add the following key value setting under appSettings Section in app.config file. <appSettings> <add key=”LastOpenedfolderPath” value=”D:\MyXyzFolder” /> </appSettings> VB.Net Code to Retrieve and Store the latest one: Dim folderDlg As New FolderBrowserDialog ‘Retrieving From config file. If there is wrong path was stored in config file, it will open the default Root [...]
asp:Menu in IE8
In IE8, i was not be able to see the dynamic menu items when hovering over the menu created with <asp:menu>. after googling, we found solution to this problem. add the css class .adjustedZIndex { z-index: 1; } and refer to the above cssclass in <DynamicMenuStyle> of <asp:Menu> like below. <asp:Menu ID=”Menu1″ runat=”server”> <DynamicMenuStyle CssClass=”adjustedZIndex” /> </asp:Menu> [...]
VB.NET 9.0: Object and Array Initializers
check out : http://blogs.msdn.com/wriju/archive/2008/02/05/vb-net-9-0-object-and-array-initializers.aspx
FolderBrowserDialog
FolderBrowserDialog allows to create, browse and select the folder from the file system. the SelectedPath will be a string containing the path to the selected folder. ShowNewFolderButton property to control if the user is able to create new folders with the New Folder button. FolderBrowserDialog is a modal dialog box; therefore, when shown, it blocks [...]
Insert Null value in Access db
strSql = “INSERT INTO tbl (clmn1,clmn2) Values(1,null)”
.net Debuggers
1. CorDBG – command-line debugger. To use CorDbg, you must compile the original C# file using the /debug switch. it resides in “C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\“ 2. DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR. it resides in “C:\Program Files\Microsoft.NET\SDK\v2.0\GuiDebug” more information : http://blogs.msdn.com/noahc/archive/2006/01/04/509450.aspx
Distinct rows from Datatable
we can get distinct rows from a datatable by following way… myDataTable.DefaultView.ToTable(True, “myDistinctColumnName”) First parameter takes boolean value for mentioning we need Distinct or Not. passing True is for Distinct records.
Retrieving ip address from connectionstring of app.config file
Here is an example of retrieving ip address from connectionstring of app.config file. ==> you must referece system.Configuration dll to your project. =========================== imporst system.configuration Dim connStr, serverIP As String Dim startIndex, endIndex As Integer serverIP = “” Try connStr = ConfigurationManager.ConnectionStrings(“MyConnectionString”).ConnectionString startIndex = connStr.IndexOf(“server=”) + 7 ‘ (server=) has 7 characters in it endIndex [...]
datetimepicker: displaying date in custom format
In datetimepicker, if we want to display date somewhat like below 31 March 2009 then we can do this by setting following properties customFormat : dd MMMM yyyy format : Custom
Datatable: Filter with Wildcard Characters
To filter data in datatable use dt.Select(“ItemName LIKE ‘*product*’”) Date type: filter_string = ” taas_data_inizio = #” & dtpDataInizio.Value & “# “ String type : filter_string = ” emp_name LIKE ‘*” & txtEmpName.Text & “*’ “ more details : http://msdn2.microsoft.com/en-us/library/system.data.datacolumn.expression.aspx