.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

When I save query results to a csv file I get spurious characters at start of file

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :

If I edit a csv file created from a query result there are three spurious characters at the start of the file.

If I save the file using ansi encoding (clicking on the down arrow next to save button and selecting ansi) the characters do not appear, which is what I want.

Is there any way to default to ansi encoding when saving query results to a csv file?

View Complete Post

More Related Resource Links

How to configure the file results of a query to custom delimiter


Hi all,

I use to do it is MS-SQL Analyzer to SQL 2000, but now with new MS SQL 2008 Management Studio I don't know how.

In the Tools->Options->Query Results to a file there isn't a option to custom delimiter... that I can see...

Any help would be apreciated.





Export query results to CSV file changing the delimiter to something other than comma


After running a query I can right click on the results grid and choose "Save Results As..." and choose the format as "CSV (Comma delimited)".

My issue is that the text includes commas and when I import to Excel there are extra columns.

Is there a way to select the character to delimit the exported text when saving to a file?



Excel file not showing in search results

We have a strange issue. I have one Excel document (or at least one that I am aware of) that will not show up in search results for content within the document. I can find the document by title just fine, but when I search for words within the document I do not see it. The document was originally a 2003 Excel document and was recently converted to 2007. Other than that there isn't really anything unusual about it (some formatting stuff, but mainly just background colors and whatnot, nothing fancy). The crawl log shows the document was crawled without error. Anyone know anything else I can check on?

Insert image into Infopath form and save to SharePoint as PDF file


I have an InfoPath web-enabled form in MOSS 2007, that is integrated with a K2 blackpoint process for an approval workflow.

Once the form (a Purchase Order request form) has been approved in the K2 workflow process, I switch the form view to a "print-friendly" view for the requestor to view from the browser.  However, now I need to go one step further with this scenario:

1) I need to somehow insert/embed an image with the scanned-in signature of the approver (likely stored in a SP doc library) at the signature line section of my form.  Also, what are the security requirements for storing such images, but not granting all users access to these (e.g. only services accounts that need to access this for embedding into the form, etc.)?

2) Then I need to convert this final "print-friendly" view of the form (with the signature image) to a PDF document so that I can store it in SharePoint (and email it to the requestor using K2's email event capabilities).

Can anyone help me with a solution to both of these requirement, or point me to some resources for this (even 3rd party components are open-game).



Error: Do you want to save this file, or find a program online to open it?



I am relatively new to MVC , i am getting the following error when i try to browse to a page in which i have used usercontrol and within the usercontrol i have a simple grid.

Error: Do you want to save this file, or find a program online to open it?

I am returning the data from the controller like this

 var jsonData = new
                    total = 1,
                    page = 1,
                    records = myRequests.Count,
                    rows = new[]{myRequests.ToArray()                 

how to automatically save new file into document library with a unique name or ID?

I've created a form using MS Word Document (2007) and lock it (protect it) so that users will be able to fill in the required fields.
then i've created a Content Type and uploaded the MS word form to be used as a template.

Then I've created a document library and enabled the content type and associate the above form for the library, so that when users click on New button the form will open.

everythings goes fine till here.

The problem is when users clicks on New and save the file back to the library, It doesn't save it with a unique name, instead it is over writting the existing one.
in other words, if employee 1 fill up the form and save it and later on employee 2 accessed the library and fill up a new form, he will overwrite what employee 1 has already saved!!

Is there a way to give every new created file a unique name? maybe (username+time)??

Word save file on SharePoint via mapped drive


Hi, I have a Document Library mapped to a drive letter. I am able to browse the drive through Windows Explorer. However when I try to save a document to the drive Word returns, 'Unable to connect to the Web server.' .  I have been unable to find any information regarding this error message. If I try to create a document in the Document Library through Windows Explorer and the mapped drive, I get a different error message: 'Unable to create the file 'New Microsoft Office Word Document.docx' There is no user session key for the specified logon session.' After I click OKand refresh the directory, a 0 KB New Microsoft Word Document.docx file has been created. When that file is opened, it is in Read-Only mode.


Windows Server 2003 R2
Webclient service started
Signed into the Microsoft Online Services Sign in Application
IE configured through the sign in application
site added to the trusted sites in IE

Thank you again for your input.

attempting to restore to a new DB and it keeps trying to save the mdf file as the original mdf file

This is using SQL Server 2005. I've had several problems and this is where I've ended up. 1. Despite the claim that this will create a new DB it doesn't.  I was getting errors about the new DB not having the specified logical file name (despite the new DB not existing).  At the time I was specifying the logical file name as it appeared in the backup. 2. if I manually create the DB I still get the error as above unless I manually change the logical file name via sql management studio.  This is meant to be an automated solution so that is not accceptable. 3. I am now giving it the logical file name of the DB that I want to restore onto (if it doesn't exist I create it), but now it's trying to save the file with the old physical file name, which is absolutely *not* what I want. My instincts tell me I need to change the logical file name in the database I'm wanting to restore onto, but I don't know how to do this via SMO.  All of the explanations I've seen are through the SQL Management Studio and that is not acceptable as this needs to be an automated solution. I have copy/pasted the code from the msdn examples verbatim changing only the dbName and the .bak file location and it has consistently failed. Here is the code in it's current incarnation. var serverName = @"myServer"; var dbName = "MIQDesignTest3"; var backupFileN

Download a file from web and save dialog box for path

Hi I need to download a exe file from a web site. I need to prompt a savedialog box for the user to select a path to save it. This the code i have. How can i show a save dialog box here?         Private Sub downloadfile()         Dim client As New Net.WebClient         client.DownloadFile("www.mysite.com/Information/Myexe.exe", "Sr.exe")     End Sub Thanks

How to save form data to delimited file?

I tried searching, but maybe I was putting in bad keywords =\How do I go about saving form data into a delimited file?

Can't save SQL Server Management Studio sql file back into Sharepoint Document Library

I created an sql query file in SQL Server Management Studio and saved it onto my hard drive.  I then moved that file into a Sharepoint Document Library so others on my team could use that query.I opened the file from within sharepoint, it launched SSMS.I made a change to the file and pressed save.here is the error message that comes up."The operation could not be completed.  The process cannot access the file because it is being used by another process"Am I doing something wrong?

How do you specify special characters as flat file delimiters?

I have a flat file that has fields delimited by tilde {~} and rows delimited by {CR}{LF}.  The problem is, my source is spitting out the {NULL} (&H00) at the end of the row. The data displays correctly in the pre-viewer (with a non-print symbol at the end of the last field), but gives an error when I try to run the package. Example: "data"~"data"~"data"{NULL}{CR}{LF} I can process the row in c# using: "\0\r\n" as the row delimiter.   What is the equivalent notation for SSIS?   Thanks,

How to access and query SDF file?

I get a sdf file.  I try to access it using SSMS 2005 and I get this error: You are trying to access an older version of a SQL Server Compact Edition database. If this is a SQL Server CE 1.0 or 2.0 database, run upgrade.exe. If this is a SQL Server Compact Edition 3.0 or later database, run Compact / Repair. [ Db version = 3505053,Requested version = 3004180,File name = D:\test.sdf ] (SQL Server Compact Edition ADO.NET Data Provider) How can I find out the edition of the SDF?

Event handler that will take an e-mail sent to a doc library and save it as an .MSG file within the

Hi All, I have a requirement to create an event handler that will take an e-mail sent to a doc library and save it as an .MSG file within the library? Any help/inputs on getting this done is much appreciated.  Hanif

Sql Server 2005 ( remove header information from query output file "Job 'bustd_Daily_Query_Output_1

Dear All,I have scheduled job for querying output & asve it into particuler folder....but in the top of file i getting the message like "Job 'bustd_Daily_Query_Output_13July09' : Step 1, 'Query1' : Began Executing 2009-07-13 16:32:06"I want to remove this & want output in txt file format without above header....RegardsRavendra Cindia

Drag drop functinality not working on Explore View control for file containing special characters in

We have created a control which uses explorer view control for file drag and drop. This functinality works fine for a file having filename without special characters but it gives an error if we drag and drop a file having special characters in the file name. The reason for this is Sharepoint uses WebDAV protocol for file transfer to the Sharepoint document library and WebDAV protocol has limitation that it does'nt accept file with special characters. Please let me know the way how I can accomplish drag and drop of file with special characters in file name, onto Explorer View control with WebDAV.

Would like to use an Excel file on the net then save changes

I have an excel sheet that i would like to use on the net. I can convert it using spreadsheetconverter but it will not save the changes as it converts it to an htm file.  But works (limited functions though, it wont convert sliders) Can I use VWD somehow so it reads the excel file and then if I make changes, to save them to the file. So when I view it again no the net it sees the changes?? Goal is the use the excel file on the net without having to have it on someones computer I just started VWD  
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