Web Forms ::how To Modify The Code For The Excel To Work With A .csv File
Aug 20, 2010
In my orginal post i asked the question to handle this within the .Net side.
I was trying to stay away from using SSIS package, and with help from another member, i was able to get the process to work with an excel spreadsheet.
But part of my project requires us to allow .csv files.. so my question is how can i modify the code i have now for the excel to work with a .csv file?
You can find the current code in my original post here:
[URL]
I not sure what the best solution is for the end result.. I was reading somewhere online that you can right the data from the file to a datalist or gridview so you can present the user with a view of what is being uploaded, then use that datacontrol to insert into SQL.
In my current code, im uploading the file, then using that file to do the insert. This works fine for .xls files.. but i need to accomplish the same thing for a .csv file.
I am trying to modify an xml file from my aspx code. The file is in another directory from my project like in D:folderfile.xml When publishing my code and running it I am receiving an error as not to be able to access this directory, access in denied. Which user account shall I add to this folder in security option to be able to modify it. I tried adding IIS user but it does not seem to work.
I am using some code I found that generates a random password. I am in the habit of putting code in a seperate file. The code was written in the same file and I'm trying to move it to a seperate file and get the following message. Also, below, I posted the original code (code on same page as aspx) and what I did (code in seperate file).what adjustment needs to be made to make the seperate code file work?
Compiler Error Message: BC31143: Method 'Public Function GeneratePassword(length As Integer, numberOfNonAlphanumericCharacters As Integer) As String' does not have a ignature compatible with delegate 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'.
I've done a search and read a few things, All i'm trying to do is set a variable in the code file and call it in the page file asp.net vb.net 3.5. I've tried like this in the code file:
[Code]....
And in the design part of the page:
[Code]....
But it says that name isn't declaired. What am I doing wrong?
I have a WCF 3.5 service with JSON and a aspx page consuming it by using ASP.NET Ajax Library
I was able to call service succesfully.In the aspx page I wrote my Java code directly and then I wanted to modify my JS function but it is always picking the old JS function code
I even restarted the machine no change, looked up on the internet, msdn and I have Default pool with Integration mode
I created a WCF service (.NET 3.5) that grabs data from a db and returns a list of objects. It works just fine. I tested it using the WCFTestClient application and got the desired results.Now, I tried to create an ASP.NET web application and consume the service. After enabling <serviceDebug includeExceptionDetailInFaults="true"/> in the config file, the error message is "Object reference not set to an instance of an object."How do I modify the service to work with ASP.NET?
Update 1 - I created a reference to the service. When I ran my very basic testing app, based on the sample code displayed on the service's default web page, I got the "Object reference not set to an instance of an object" message.The service is returning the correct results when I use the WCF Test Client utility provided with Visual Studio. When I try to use the following code, all in the page_load event, I get the object reference message.
PhoneNumberServiceClient client = new PhoneNumberServiceClient(); // Use the 'client' variable to call operations on the service List<PhoneNumber> phones = client.GetPhoneNumbers();
I am workining on a large site for a client. I have a control (an asp.net textbox) that is rendering with two class tags i.e.:<textarea class="x" class="y" />I have no idea how or why that is happening and I dont expect to find an answer here.however I hope that one of you can tell me the best way to debug it.I would like to see how that control is being by asp before any other code has a chance to modify it (the site uses telerik controls but the control in question is an asp.net textbox control).
I need to read an Excel work book with 2 sheet which have more than 60,000 records. The application is an ASP.Net application so the performance matters.
Which approach should I take? Sohuld I do it using Microsoft.Office.Interop.Excel or should I do it using OLEDB in ADO.Net?
How do you modify a ASP.NET MVC 2.0 project to work with the Spark View Engine?
I tried like described here:
[URL]
But somehow it still tries to route to .aspx files.
Here the code of my global.asax:
public class MvcApplication : System.Web.HttpApplication { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute(.......
Now the same code when I copy it in my project having masterpage . there is no compiler error but it is genereating excel file withno data in it but in fact there is data in the grid view at runtime.
I'm using a sqldatasource to retreieve and display values in a listview. I used a list view since I wanted to use custom formating. I have an itemtemplate with the retreieved values. I have list one of the rows
I have json file Users.json and I want read json object from file and store in to database one by one. how to delete json object when it stored in database. when object not save in database then it not delete from file. Need to know about delete json object.
using (FileStream fs = new FileStream("user.json", FileMode.Open, FileAccess.Read)) using (StreamReader sr = new StreamReader(fs)) using (JsonTextReader reader = new JsonTextReader(sr))
I would like to find a way to read a txt file (in my case delimited by €). I need to change the order of the columns and also add and remove some columns. My output file should be a txt file delmited by ;.
I tried Jet.OLEDB to read the file and put it into a datatable and then used a stringBuilder and streamwriter to get an output file in .txt format. However. This does not me since IŽ, reading the txt file from start to end and my output will be the same. It does not seem like I can have a custom sql statement when reading the file. The only query that works is
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from 1.txt", TextConn)
by looking at using the XmlDocument and creating elements and attributes and then inserting them into the document. Pretty soon this looked like a massive amount of work for all the elements I have to add.What are the repercussions of treating the config file as one big long text string and doing a replace at certain points to add my entries. Something like this...
private void InsertXMLElement() { StringBuilder webConfig = new StringBuilder(); // get the file into a stringbuilder for manipulation using (var sr = new StreamReader("C:web.config")) { webConfig.Append(sr.ReadToEnd());
I'm repeating my question because the prior one under this topic was lost.
I want to use MicrosoftReportViewer for Web Forms so that the DataSource be set programmatically. There is some sample code on the Internet for Windows Forms but I haven't found anything for Web Forms. For example, here is some code I've tried to use. It gives no errors but nothing is displayed.
How should I modify the code to display a table in the ReportViewer?
I am doing some research on themes in asp.net. (Just Learning) is this a practical use of my time? Should I just use css files and if someone wants to modify anything let them use the css to do it? Are themes a waste of my time? I really want to create my app but give the end user the ability to customize the look and feel without jumping through hoops. Can someone push me in the right direction with pros, cons etc