.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

how to get files in vb.net in all directories.I had written the code.if u see in the detaild message

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :ASP.Net

This is in class file
Imports Microsoft.VisualBasic
Imports System.IO
Imports System.Collections.Generic
Public Class FileSrch
'' File Search Options
Public Enum FileSearchOptions
End Enum

Public Shared Function GetSearchcriteria(ByVal DatetoSearchwith As Date, ByVal Filename As String, ByVal FileExtension As String, ByVal SearchOptions As FileSearchOptions)

Select Case SearchOptions
Case FileSearchOptions.YearFirst
Return String.Format("{0}_{1:yyyyMMdd}{2}", Filename, DatetoSearchwith, FileExtension)
Exit Select
Case FileSearchOptions.MonthFirst
Return String.Format("{0}_{1:yyyyMMdd}{2}", Filename, DatetoSearchwith, FileExtension)
Exit Select
Case FileSearchOptions.NormalFiles
Return String.Format(Filename + FileExtension)
Case FileSearchOptions.DateinExtension
Dim ExtensionFormat As String = (Convert.ToInt32(DatetoSearchwith.ToString("mm")).ToString() & DatetoSearchwith.ToString("dd"))
'' Month in Double Digit
If DatetoSearchwith.Month > 9 Then
ExtensionFormat = (DatetoSearchwith.ToString("mmm")(0) & DatetoSearchwith.ToString("dd"))
End If
Return String.Format("{0}.{1}", Filename,

View Complete Post

More Related Resource Links

Code Name WinFS: Revolutionary File Storage System Lets Users Search and Manage Files Based on Conte


One of the monumental problems organizations face today is aggregating information that's stored in disparate formats. Knowledge workers have long wanted to be able to search for content independent of format. The next version of the Windows operating system, code-named "Longhorn," boasts a new storage subsystem that makes that task easier. That subsystem, code-named "WinFS," allows the user to perform searches based on the metadata of the stored item, regardless of what type of file it is or which application created it. This article covers the basic architecture of WinFS and explains how to use the WinFS managed API.

Richard Grimes

MSDN Magazine January 2004

DIME: Sending Files, Attachments, and SOAP Messages Via Direct Internet Message Encapsulation


Direct Internet Message Encapsulation (DIME) is a new specification for sending and receiving SOAP messages along with additional attachments, like binary files, XML fragments, and even other SOAP messages, using standard transport protocols like HTTP. In this article, the author explains what DIME is and how it differs from MIME encapsulation. A detailed description of the message format and how it is parsed, as well as working with SOAP and extending it with WSDL, is also included.

Jeannine Hall Gailey

MSDN Magazine December 2002

External Code Assemblies, Report Subscriptions, and configuration files

I've got a report that relies on a very small external assembly for data for one of its fields.  That assembly, in turn, relies on some values from System.Configuration for portions of its work. I have the configuration keys and values running fine in the web interface, set up in web.config, but when users set up subscriptions for the report it runs fine but doesn't retrieve the configuration values from web.config (as expected) nor does it retrieve them from rsreportserver.config, where I have tried them in the root of the config file as <add key=... /> entries and also by wrapping them inside an <appSettings /> node.  I have also tried them in an appropriately-name config file in the bin directory.  In all cases the report is fine except the field that relies on the external assembly, where I recieve an error indicating that there's missing information (the config vals are used in a String.Format() call): Value cannot be null. Parameter name: format at System.String.Format(IFormatProvider provider, String format, Object[] args) at ExternalDBFunctions.ExternalSelectors.GetNotificationStati(String NotificationID) mscorlib When I remove the config values from the web.config, the web interface shows exactly the same error. Where should these configuration values go?

Data from text files, What's wrong with my code?

Hi all, I have uploaded some tab-delimited .txt files on my web site (actually run on my computer, ie localhost, for now), and now I try to retrieve the data from those files. I do this by calling a vb file containg the sub below. Everything works great, except that the sub won't recognise unicode characters. I can split the resulting string using vbnewline and vbtab, but already in the sub in question, the string doesn't understand the Swedish letters åäö, apostrophes and more. Any help would be greatly appreciated! /Pettrer       Shared Function getTextfile(ByVal FullPath As String, Optional ByRef ErrInfo As String = "") As String Dim strContents As String = "" Dim objReader As StreamReader Try objReader =New StreamReader(FullPath) 'UTF8Encoding? strContents = objReader.ReadToEnd() objReader.Close() ErrInfo = Ex.MessageCatch Ex As Exception End Try Return strContents End Function  

What topics cover this code that was written in Classic-ASP?

Hey guys,So, I have a very simple bit of ASP on my website currently, which you can check out here:  http://www.marioplanet.com/catalog.aspJust ignore the CSS issue for now! :)Anyway, so, I have a SQL Server table in a database, and I'm pulling some information from it to make a shopping catalog of all my products.I was wondering if there is any need to convert this to ASP.NET, and if I should, as I'm eager to learn how, which topics of ASP.NET does this include?I would assume handling data through a SQL Server Database Table?Also, which ASP.NET framework is best suited for this kind of work?  For the most part, the only ASP.NET code I'm going to be using, is going to be handling data from a database.  Other than a few conditionals and what not.Any ideas and suggestions are greatly appreciated!Thanks!! 

Uninstall error -- The timestamp marker on log files has been set. Error code 0x84B20001

I need to uninstall from the command line for an application we are writing SQL Express 2008.  I am using the following command to debug an error message,   setup100.exe /ACTION=UNINSTALL /INSTANCENAME=SUNKIST /FEATURES=SQL   and I keep on getting an error message:   SQL Server Setup Failure The timestamp marker on log files has not been set.  The timestamp must be set set prior to it being used for the first time.  Error code 0x84B20001   the log files seems to have problems in the following area,    Running Action: SaveFeatureStateAction2008-10-01 15:00:51 Slp: Completed Action: SaveFeatureStateAction, returned True2008-10-01 15:00:51 Slp: Completed Action: ExecuteUninstallCalculateWorkflow, returned True2008-10-01 15:00:51 Slp: ----------------------------------------------------------------------2008-10-01 15:00:51 Slp: Running Action: ProduceStatusLogs2008-10-01 15:00:51 Slp: Error: Action "ProduceStatusLogs" threw an exception during execution.2008-10-01 15:00:51 Slp: Microsoft.SqlServer.Setup.Chainer.Workflow.ActionExecutionException: The timestamp marker on log files has not been set. The timestamp must be set prior to it being used for the first time. ---> Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException: The timestamp marker on log files has not been set. The timestamp must be set prior to it being used for the first time. --->

write server side code in External JS files

Salam To All,for my JS code, some times i need to organize my code, so i prefer to put some of javascript functions in external js files and  include it in my page as well.but i am face a problem if i need to write some .Net code especially to Get the Client ID for any of .net controls.so do you have a way to write the following code in External JS file?('#<%= this.ddlMake.ClientID %>').change(function(

JQuery: is there a way to show status message - from code behind?


i am trying to figure out how to display message box after it done executing the server side code

 here is the code which works from the client side but still looking for a way to make it work from code-behind


<div id="status"></div>


$("#status").fadeTo(500, 1, function() { $(this).html("You are now registered!").fadeTo(7000, 0); })

.NET 3.5 SP1 failed with the error message - Error code 1603 for this component means Fatal error du

I had Beta version of VS 2008 and I wanted to install .NET 3.5 SP1. Installation led to some serious problems. I tried almost everything to install .NET 3.5SP1 (or VS 2008 SP1), nothing works

* VS 2008 has been uninstalled
* 3.5 uninstalled and cleaned
* 3.0 uninstalled and cleaned
* WF components removed
* document manager components removed

when I try to reinstall 3.5SP1, I keep receiving the following error in dd_dotnetfx35error

[01/11/09,00:23:05] XPSEPSC Installer: [2] Error code 1603 for this component means "Fatal error during installation.
[01/11/09,00:23:06] XPSEPSC Installer: [2] Setup Failed on component XPSEPSC Installer
[01/11/09,00:23:32] WapUI: [2] DepCheck indicates XPSEPSC Installer is not installed.

Then I check the contents of dd_dotnetfx35install for the event error log and found the following
[01/11/09,00:23:05] XPSEPSC Installer: ***ERRORLOG EVENT*** : Error code 1603 for this component means "Fatal error during installation.
[01/11/09,00:23:05] Setup.exe: AddGlobalCustomProperty
[01/11/09,00:23:06] XPSEPSC Installer: ***ERRORLOG EVENT*** : Setup Failed on component XPSEPSC Installer
[01/11/09,00:23:06] Setup.exe: GetGlobalCustomProperty - Property: {BBE1827C-F2FD-4FDA-A6D6-C83B62FFFDCA} - PropertyName: compfailed - Value: 0
[01/11/09,00:23:06] XPSEPSC Installer: CBa

Issue with designer files not updating -- and therefore cannot code



I have a problem in which some nested controls on a page are not updated in the designer file. I have deleted the designer file, selected Convert to Web Application, but still the controls are missing.

I know there is a supposed fix at http://blogs.msdn.com/b/webdevtools/archive/2010/03/05/hotfix-for-issue-with-auto-generated-designer-files-not-adding-controls.aspx

Unfortunately the patch won't install and I still have the issue.

Any thoughts? I am running VS 2010 Version 10.0.30319.1 RTMRel.



Getting error message and other data back from SSIS to managed code




From a SharePoint workflow we are trying to synchronously execute an SSIS package - which seems to work - and display error messages and return some variables back to SharePoint.


I followed the "Running a Package Remotely by Calling a Remote Component or Service" instructions on http://msdn.microsoft.com/en-us/library/ms403355.aspx and executing and parameterizing the package does not seem to be a problem. But the SSIS package does a lot of plausibility checking and raises an error (RAISERROR in T-SQL or Error

Setup file(*.msi) also includes .aspx.cs (source code) files also


My project is recently migrated from 2008 to 2010

actualy we developed project in VS 2005 in that we created setup file but when we migrated to vs2008 setup file giving problem to us.

now when we make setup file it is including .aspx.cs files also but this if we publish our project it wont including source code.

why setup file including .aspx.cs files is there any way to change.

plz replay ASAP

Moving directories/files from the server to another network location


In my asp.net wep application i would like to move the folders from the server to a network location so that the server doesnt get filled up...................

i was able to move the files within the same drive but not to other network locations ..........

So please help me in finding a reliable solution

How to use 2 xaml files with one code behind


Hi all,

I am developing a SW that can automatically detect the render ability of current machine then decide what GUI file is loaded. At this time, I have to create these files:

1. HighResGUI.xaml + HighResGUI.xaml.cs

2. LowResGUI.xaml + LowResGUI.xaml.cs

Both HighResGUI.xaml.cs and LowResGUI.xaml.cs are the same, only the xaml has different styles (due to the render capability of the current machine). This can solve my problem, at this time. However, when I want to modify one xaml.cs code, I have to do it twice for both High and Low.

So my question is, how can I combine these two different interface (HighResGUI.xaml+ LowResGUI.xaml) and use only one code behind, for example common.xaml.cs?



OCIEnvCreate failed with return code -1 but error message text was not available.



We have a requirement to connect to oracle from ASP.NET and we installed ODAC(ODAC1110621) components  on the server but still we are getting the following error while opening the connection. Please find the details below:-

OCIEnvCreate failed with return code -1 but error message text was not available.

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.Exception: OCIEnvCreate failed with return code -1 but error message text was not available.

Source Error:

Line 16:     {
Line 17:         OracleConnection con = new OracleConnection(ConfigurationManager.ConnectionStrings["HRDBA"].ConnectionString);
Line 18:         con.Open();
Line 19:         Label1.Text = con.State.ToString();
Line 20:         con.Close();

Source File: \\hs003fs01-02.homebase.com\wfmp\Webpage1.aspx.cs    Line: 18

Stack Trace:

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend