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

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

The path is not valid

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :Sql Server
this is my connection string :(dunno whether it is correct or not)

Public con As New SqlCeConnection("Data Source= C:\Mobile Transaction in Learning System\LS.sdf")

the error:
The path is not valid.check the directory for the database. [path = C:\Mobile Transaction in learning System\LS.sdf]

this i see from other solution but i dun understand where should i put ?? where is the emulator ???

You can only access files located on the emulator, not your local drives. You have to copy or create the sdf file in the emulator in the desired location. There is no C: drive or D: drive in the emulator, just a "\" root

please help

View Complete Post

More Related Resource Links

Path not valid.



im trying to save a file, filename as current date and time.it will give an error.

any ideas.

here is my code

string datetime=DateTime.Now.ToString();

if (GridviewtoCSV("~/Admin/doc/Reports/" + batchid.ToString() + datetime + ".csv", transactiongrid) && GridviewtoPDF("~/Admin/doc/Reports/" + batchid.ToString() + datetime + ".pdf", transactiongrid))

FileWatcherTask - Path specified is not a valid directory


I get this error when using a FileWatcherTask. I have a mapped path that will not work in the FileWatcherTask. I have given permissions to the domain account used by SQL Agent to the folder being attempted.


1. Are the spaces in the folder name the issue?

2. If a mapped drive or UNC not workable in SSIS, how do you reference a directory on a remote server?


When I test using  E:\Workbooks (a local folder) I get this error:


[FileWatcherTask] Error: Fatal error during Task Execute. Second path fragment must not be a drive or UNC name. Parameter name: path2


Question: What is Parameter name: path2 and how do you set the properties?


When I use the \\fileserver\finDeptData$\[Daily Count Totals], I get this error on package validation:


TITLE: Package Validation Error

Package Validation Error


Error at File Watcher Task [FileWatcherTask]: The Path specified is not a valid directory. Please check directory

OLEDB Connection for Excel not a valid file path


Hi there, I'm using a FileUpload control on a webform to allow users to select an excel file. I then want to read the excel file and dump the data into a dataset, but I can't get it to work. This is my code:

Dim fileNameString As String = Me.BillUpload.FileName
Dim filePathString As String = Me.BillUpload.PostedFile.FileName
Dim fileLength As

gettting exception when uploading a file using IE 6??? not a valid virtual path




I have a file upload control and just in IE 6 I get the following error when I try to upload a file. My code is further below.


 Exception Details: System.Web.HttpException: '/Members/path//C:\Users\Public\Pictures\Photos\Sample Album\Pensive Parakeet.jpg' is not a valid virtual path


MembershipUser newUser =


        HttpFileCollection uploadedFiles = Request.Files;

        for (int i = 0; i < uploadedFiles.Count; i++)


            HttpPostedFile file = uploadedFiles[i];
            string fileExt = Path.GetExtension(file.FileName).ToLower();
            string fileName = Path.GetF

'c:\test.xml' is not a valid virtual path.


Hi all,

I had problem when I run the following code

It stated that 'test.xml' is not a valid virtual path. I had check that physically the file does exists.

The program will stop at the Server.MapPath.

Please help.




objdata = new DataSet();

try {



objdata.Tables[txtProdID.Text].DefaultView.RowFilter =

"prodid='" + x1 + "'";

if (objdata.Tables[txtProdID.Text].DefaultView.Count>0)









catch (

Using a CompareValidator to check input is a valid date

The CompareValidator can do more than just compare two controls. You can also compare it against several of the main .net data types such as Date, Integer, Double and Currency.

To do this you would set Operator="DataTypeCheck" and instead of setting the ControlToCompare or ValueToCompare attributes as you normally would you use the Type="Date" (or any of the data types I have listed above).

Virtual Path Problem


 I get the following error on last line below (working on remote host): 'E:\web\sfcascom\ls_admin/uploads/images/001.JPG' is not a valid virtual path,

Note that the slashes go in different directions

I've tried a number of things but nothing seems to work. Thanks-


Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Imaging
Imports System.Web.UI.WebControls

Imports System.Drawing.Imaging.ImageCodecInfo
Partial Class Protected_imageupload
    Inherits System.Web.UI.Page
    Private Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
        ' Initialize variables
        Dim sSavePath As String
        Dim sThumbExtension As String
        Dim intThumbWidth As Integer
        Dim intThumbHeight As Integer
        Dim sFilename As String = ""
        ' Set constant values
        'sSavePath = "images/"
        sSavePath = Server.MapPath("~/") + "ls_admin/uploads/images/"

        sThumbExtension = "_thumb"
        intThumbWidth = 160
        intThumbHeight = 120

        ' If file field isn?t empty
        If FilUpload.PostedFile IsNot Nothing Then
            ' Check file size (mustn?t be 0)
            Dim myFile As Http

Creating a user friendly alias for the website path


 Hello mates,

I am hosting my ASP.NET application on a Windows 2003 Server.

To browse to my application one has to type the path :http://serverName/applicationName

I want users to only type  applicationName on the web adress area.I believe there is something to do with alias and CNAME on DNS records that can adress this.

Any help on how to go about doing this will be highly appreciated.

How to set SearchRoot Path in Active Directory in this scenario


How to set SearchRoot Path in Active Directory in this scenario:

Functionality: We have scenario that 1<sup>st</sup> hit one LDAP server with some 'fixed user name' &' fixed password ' and filter data with specific User name(which given by user) getting 'User dn'.

After that we hit Next LDAP server based on the 'User dn' getting from 1<sup>st</sup> server.

(So, in my case 1<sup>st</sup> LDAP server works like as Load balancing server but functionalitywise it is different)


ReportViewer :: Failed to enable constraints. But my statement is valid!!

  • A
  • n error has occurred during report processing.
      • Exception has been thrown by the target of an invocation.
        • Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

    Why do I keep getting this error, even when not using any data on the report. When I run the query in SQL server I get a resultset. However when I try to render the report I get this error.


    Split URL/Path in Classic AND .net 2.0


    I need to be able to get the different parts of the URI (and convert from/to relative page paths) in BOTH classic ASP and .Net 2.0 (VB).

    For example, if I have "http://sitename.company.com/index.aspx?sec=fred&pag=dis&mode=1" OR "/index.aspx?sec=fred&pag=dis&mode=1"

    IS there a function where I can pass in either string (assuming I'm on sitename.company.com) and get back an array with:

    (0): sitename.company.com
    (1): index.aspx
    (2): sec=fred&pag=dis&mode=1

    (Or, alternately, three different functions that would return the three parts?)


    Scale Out: Distributed Caching On The Path To Scalability


    Developers frequently face issues related to scalability bottlenecks when they have applications that need to handle a lot of load. This article describes the role of a distributed cache in building scalable applications.

    Iqbal Khan

    MSDN Magazine July 2009

    Foundations: Render Text On A Path With WPF


    With Windows Presentation Foundation (WPF) you can lay out text on a path, then animate the individual points defining the path and watch the characters bounce around in response.

    Charles Petzold

    MSDN Magazine December 2008

    Conversion from string to type 'Date' is not valid



    Im receiving a strange error Error Message: Conversion from string "15/08/2010 22:21:35" to type 'Date' is not valid.

    I know this is generally down to cultural date formats etc, however the reason this is strange is it just randomly occured twice in the last week, the website has been running since october and nothing has changed,

    The error constantly occured until the IIS was reset and recompilled the site, its been running fine since, however im just trying to figure out what could cause such an error to occur.

    I've narrowed it down to a line of code which is:

    bktime = DReader.Item("Bktime").ToString

    bktime = Year(CDate(bktime)) & "-" & fmt(Month(CDate(bktime)), 2) & "-" & fmt(Day(CDate(bktime)), 2)

    Has anyone else encountered this randomly occuring and is there anything i can put in place to prevent this in future?



    override error message (The value 'test' is not valid for Age) when input incorrect data type for in


    Hello everyone,

    I've tried to override error message when input incorrect data type in input field on HTML form. For example I have the model like this.

    public class Person
    public string FirstName {get;set;}
    public int Age {get;set;}


    For view, I put text input for Age to get it value.

    When type some string in Age text box like 'test' and press submit button. I got this error message

    The value 'xxx' is not valid for Age

    However, I want to change this message and try many way. There 's nothing effect this message value.

    Please could you help me to solve this problem.

    report definition is not valid



    I recently upgraded to VS 2010.  One on of my reports I am getting the following error.  Can someone help?

    The report definition is not valid. Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition' which cannot be upgraded.

    Thank you.

    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