Last time I had to do something like this... thousand of rows in excel files to insert into an Access DataBase...
What I did was.
First, create a typed dataSet with the structure of the Target Tables... ( autogenerate the Insert Command ).
Now the problem is only to fill the DataSet.
First Open the Excel with the COM Object for Excel... and go column by column.... bla bla... and create a row of the DataSet for each row in the Excel file.... and so on..
Second, Export the Excel file to a CSV file and open the txt file from your application and open the file, read line by line and do a split using the ',' the comma, after that do a loop for each line creating a new row of the DataSet...
If there are many lines in the excel files, I recomend you to update every 100 or 200 rows...
I have one GridView and in this gv i have two column one is mark-printer other is model-printer.So i done this column like template but i don't know how to do exchanging of data when i doing edit???I mean if i choos for example "HP" i want to see only models for hp not all how to link both controls pleas help me.
Good bye best regards
I'm have a little problem with my page caching. On my admin side, I have a list of members. Lets say I want to update member Dean Martin, then I would click on his name and it takes me to an update page, I will change his last name to something like Martinn. The message displays that the member has been updated successfully. Then I have a link that goes back to the members listing, then it still displays as Dean Martin. I have to press CTRL + F5, then it will only update to Dean Martinn. I don't want to do this.
Each of my pages extend from a base page, and in the load up of this page is does the following:
i am using following code to connect to ftp server on my own pc.
then i m calling following code to read response.
noofbytes = clientSocket.Receive( buffer, buffer.Length, 0 );
when i m calling this sometimes, program hangs, it does not hang when i m debugging. so i have added System.Threading.Thread.Sleep(20) to sleep program, now its working, i want to know the reason program is hanging, and also i used 20 milliseconds after experiment. it may change on different machines.
I am doing a small project in asp.net which uses MySQL as back end.there is a field to store Hours in my table.I gave the datatype of double to that field.
Now I select the contents of the table and the resultant dataset will be bound to the datagrid as usual.
Here my double Hours field is truncating the trailing zeros.If total hour is 5.30 its showing as 5.3, but for 5.15 it shows 5.15 as correctly.how to fix this.
this may be silly ...but I need help from some one......
Actually no data is lost. It's just a matter on how the data is formated when being output. Have a look here[^] to get an overview of what is possible with formatting.
Generally speaking you can format your double the way you want. In your example it should be something like:
double d = 5.3
Console.WriteLine(d.ToString()); //output is 5.3
Console.WriteLine(d.ToString("#.00")); //output is 5.30
Console.WriteLine(d.ToString("00.00")); //output is 05.30
I wanted to reset the record number on beginning of odd page numbers (Not applying to the page number 1) to immediate previous even page beginning record number. Ex. if page 2(even page number) starts with record number 1, then I wanted to reset the record number to 1 in the next odd page number (i.e. 3). Similarly if page 4(next even page number) starts with record number 26, then I wanted to reset the record number to 26 in the next odd page number (i.e. 5). This should continue through out the report. Is it possible do this? Please comment on this.
Or anybody have any idea to display lengthy records (Which has several columns) runs up to 2 A4 papers in continuous order. Ex. Assume it show 25 records in the first page and remaining columns same 25 records in the next page. Then it should show the records from record number 26 at the next page. This should continue through out the report.
I'm trying to scale down a image file, the thing is that I can't find anyway to do that without getting the image into a Grapgics object.
Using the graphics object to scale down is easy (using ScaleTransform()), the thing is that I want to convert back to Image in order to place the image in a picturebox.
Instead of changing your instance you could create a new one:
Image newImage = new Bitmap(wantedWidth, wantedHeight);
using (Graphics g = Graphics.FromImage(newImage))
g.DrawImage(oldImage, 0, 0, wantedWidth, wantedHeight);
//do something with the new image...
Last Visit: 31-Dec-99 18:00 Last Update: 3-Oct-23 4:51