Unable To Read .dbf File From Server?
Mar 14, 2010
I dont know where to put this Query.
I am trying to open .dbf file from the server for which I have written below code.
Now, the problem is connection string accepts only physical path from the client machine where as I want it to pick file from the server.
System.Data.Odbc.OdbcConnection oConn = new System.Data.Odbc.OdbcConnection();
oConn.ConnectionString = @"Driver={Microsoft dBase Driver (*.dbf)};SourceType=DBF;SourceDB= http://localhost:1308/CNCScheduling/...;Exclusive=No; Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO;";
oConn.Open();
System.Data.Odbc.OdbcCommand oCmd = oConn.CreateCommand();
string sPathApp = Request.ApplicationPath.ToString() + "/";
string sPathFull = Request.Url.OriginalString.ToString();
int iPathFullLen = sPathFull.ToUpper().IndexOf(sPathApp.ToUpper());
string sPathPrefix = sPathFull.Substring(0, iPathFullLen) + sPathApp;
string sRPTFile = "XABCL.DBF";
string sCrvPage = "D:\databases\" + sRPTFile;
oCmd.CommandText = @"SELECT * FROM " + sCrvPage ;
DataTable dt = new DataTable();
dt.Load(oCmd.ExecuteReader());
View 7 Replies
Similar Messages:
May 27, 2010
I tried this code by inputting the ftp address as ftp//: and the correct username and password and I get the following error
"Unable to connect to the remote server" on line :
FtpWebResponse Response = (FtpWebResponse)Request.GetResponse();I tired this on my ftp server provided by a hosting service and an anonymous ftp located at 193.166.120.5 ?
Note: I was able to connect to both of these ftp through filezilla, via a webbrowser, and through windows command line.
View 1 Replies
Nov 18, 2010
Iām trying to read images from an excel file using OleDbDataReader. My excel file has 6 columns of data, the first 5 are all text but the last is image. While Iām reading the record, It's doing fine on the first 5 columns but return me with a for the sixth column.
Here is my demonistration code:
[code]....
View 4 Replies
Jun 14, 2010
I used to develop web application in the XP with Visual Studio 2005.Now I have moved to the Windows 7 environment. The .Net web application works fine in browser, but I have problems to open the project in the VS2005 SP1. I have already installedService Pack 1 for Vista and Update to support Web Application Projects updates. I surelly have IIS running on my Windows 7. I'm running VS2005 as adminI get error from VS that "Unable to read project file 'abc.vbproj'. The Web Application Project ABC is configured to use IIS Web Sites, you must install all of the following Windows components.- Internet Information Services- IIS 6 Metabase and IIS 6 Configuration Compatibility- ASP.NETIn addition, you must run Visual Studio in the context of an administrator account etc.
View 2 Replies
Mar 4, 2010
I am reading data from Excel file using oledbdataadapter and binding to gridview.Every thing working fine.but if the cell is having some text along with bar sysmol ( | ) [Ex : 12345 | 789123] that cell data is not reading from excel file.All fileds in excel sheet is text format only.Some times it's reading correctly & some times it not reading(empty).Is there any problem with bar symbol ( | )
View 1 Replies
Nov 2, 2010
I have a website written in C# that was running fine on one server. We moved it to another server and have a couple issues. I am mainly a VB.NET coder but can do a few things in C#. This is not a project - it is a website and can open it in VS2008 no problem. This is an admin site for the whole website where the user can add customer comments, etc. When logging in, it works fine. I can go to one of the admin pages after logging in and works. If I go to two other different pages, I get this error:
Object reference not set to an instance of an object.
[Code]....
It turns out this is in the main.master page and it is used by the other pages that load fine. The ApplicationTitle variable is set right in the web.config file and like I said, it shows on the other pages.
My question is why would this code work fine for some pages and not two others? All of these admin pages are under a folder called Admin and the web.config file is in the root folder of the website. Its almost like these two pages cannot see the web.config file in the root folder? Why would that be if thats the case?
View 3 Replies
Feb 22, 2011
I wonder how often the Web.config file is read by the server?And if the fact of the Web.config file is too large, influences the application performance?
View 2 Replies
Jul 16, 2010
filetoread = Server.MapPath("\servernamesharefile.csv")
filestream = File.OpenText(filetoread)
readcontents = filestream.ReadToEnd()
It works fine if I put the file in the local directory and use "filetoread = Server.MapPath("file.csv")", but won't do it over the UNC path.I'm guessing the problem is security related but can't find any info related to it, do I need to somehow specify a username/password somewhere ?
View 3 Replies
Sep 23, 2010
I would like to know your libraries recommendations to read and write Excel applications on ASP .NET website. I have tried GemBox and NPOI, because they don't required Excel to be installed on the server, but they have some limitations on handling Excel files that are marked to read only.
View 6 Replies
Aug 31, 2010
How do I read/write a text file on another server from a web page.I get the error "Access to the path '//Server2/mydatafiles/test.txt' is denied". I do not get the error if I am running the browser on the server where the files exist.I think I need to set permissions on the destination server in some way.
View 4 Replies
Apr 2, 2011
using below code im reading excel sheet data by specifying the sheet name as [Project1$] but, how do i call the excel sheet without specifying the sheet name so, that it will ready any files.
string strFileName = FileUpload1.PostedFile.FileName;
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + strFileName + ";" + "Extended Properties=Excel 8.0;";
OleDbConnection objConn = new OleDbConnection(connectionString);
objConn.Open();
String strConString = "SELECT * FROM [Project1$]";
View 5 Replies
Oct 16, 2010
I am using VS 2008 with SQL in express edition . I have made my website and hosted it on server with cuteftp .Now i want to change
the website so when i tried to delete all files the App_data folder does not delete .
So i am unable delete my mdf and log file which are in this folder. It says file error.
I always use SQL in design window in VS and know less of coding in SQL.
View 5 Replies
Jan 12, 2011
I have a problem that I have been trying to solve the past two days, but I cannot figure it out...I have a folder which will have 60-70 Excel Files or CSV Files (they are right now). There are no headers in them, but they all have the same # of columns and the columns are in the same order in each fileI need to read each file in the folder, grab the data from the file and put it in a Database file. So all files will be read and then the data from them I guess put in a DataSet and then put into a Database (SQL).
View 3 Replies
Dec 20, 2010
I have a function that will take a file uploaded by a user of my system and store the contents of the file into a varbinary(max) field in a sql server database. I then display the filename of the file in a data grid for the user to see as a link button. When the user clicks on the link button, I want the file to be read from the database and served out to the user as a prompt to download the file. How can this be accomplished? The upload is fine, it is the download I can't figure out. Here is what I have so far.
[Code]....
I get the download to prompt, but it is showing the name of my .aspx page as the file to be downloaded.
View 1 Replies
May 22, 2012
How to read/open a pdf file from web site existing on remote file share?
View 7 Replies
Sep 20, 2010
How to read a .doc file from as a string in asp.net page to a literal control without format loose and to display images also.
Is it possible to read .pdf as above.
View 1 Replies
Sep 17, 2010
I have the following form
<form id="upload" method="post" EncType="Multipart/Form-Data" action="reciver.aspx">
<input type="file" id="upload" name="upload" /><br/>
<input type="submit" id="save" class="button" value="Save" />
</form>
When I look at the file collection it is empty.
HttpFileCollection Files = HttpContext.Current.Request.Files;
How do I read the uploaded file content without using ASP.NET server side control?
View 2 Replies
Oct 20, 2010
I'm getting tired figuring out this error. Well, Basically. I have uploaded my ASP.net website to a server (IIS installed) as well as the VB project I made.
BOTH are connecting to a DB named CLIENTS.
the website uses a datagrid to show data, while the VB Project updates the DB based on a monitored folder.
The Problem is If the website is opened first the VB project shows an error "Unable to open the physical file (MDF). Operating system error 32 (error not found)" and Vice Versa if the VB project is first started.
View 10 Replies
Jun 9, 2010
I have a link http://Test/Folder/file1.xls which is working fine But if I typehttp://Test/Folder/file1.xlsx it is not working. It is giving me a file not found error.So when I read online every one is suggesting me to add the correct MIME type at tyhe IIS level. I don't know if that's the correct thing to do.I opened IIS and navigated to folder FOLDER right clicked and selected properties -> HTTP Headers -> MIME Types->New -> Extension -> .Xlsx-> What should i be entering for MIME type?
View 1 Replies
Jan 8, 2010
I want to read write excel file in my application without installing the office on my server. Means my server don't have any excel (MS office) installation. Is it necessory to install the office on server to excute the program of read or write the excel file.
View 5 Replies
Aug 10, 2012
I am having a list of contents in the notepad.
I having the following content.
000012|vasanth|Sofware Engineer|Chennai|
0000215|Arun|ASE|Keral|
The field is static and the column name is ID,name,Designation,City.
I need to read the note pad charecter by charecter and i have to insert the records corresponding in the field which is seperated by "|".
View 1 Replies
Feb 9, 2011
I have a solution file which has 3 projects in it, which was developed in VB,VS 2003. when i am trying to open the solution file, framework is able to open the 1st and 2nd projects but for the 3rd project it was showing an error "Unable to get project file
from web server".
View 2 Replies
Jan 25, 2011
I have previleges to create folder and create files in the remote windows 2003 server. But I am not able to create im ny Website.
View 2 Replies
Jan 4, 2011
I have problem while try to play a swf file from server.
i am using this below code :
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="640" height="418" id="csSWF">
<param name="movie" value="FPM_Overview.swf" />
<param name="quality" value="best" />
<param name="bgcolor" value="#1a1a1a" />
<param name="allowfullscreen" value="true" />
<param name="scale" value="showall" />
<param name="allowscriptaccess" value="always" />
<param name="flashvars" value="autostart=false&thumb=FPM_Application.jpg&thumbscale=45&color=0x1A1A1A,0x1A1A1A" />
<!--[if !IE]>-->..........
But this above code work in my local development version , When i try to open from my domain like: http://domain.com/Files/ sample.swf ,not play the file but it show the timing of the swf file then the slider and info icon of the player.
Am also try to open the swf file using html file from the same domain,it not working.
View 2 Replies
Jan 6, 2011
i have a site that will enable users to download an ebook file.i have successfully built architecture to enable users to download pdf and txt files, but it won't work when i try with a .mobi file, even though i know the file exists.the site works by allowig users to upload their work as .doc, .docx or .odt. once it's verified, the site publishes it as .pdf, .txt and .mobi and makes it available for download. the download code is...
string mstitle = title.ToUpper();
string dlpath = [the server path] + msid + mstitle + ".mobi";[code]....
(there are also versions with .txt and .pdf) the file definitely exists at the location in .txt, .pdf and .mobi extensions. however, the .mobi version simply won't work i get an error 404 resource not found. mystifyingly, the pdf and txt versions work perfectly.
View 8 Replies