|
some times ago,I have used to export in excel... I was just placing an html to open in excel, and it works great for me .. . If you dont want to have excel features embedded, just use that. It doesnt require Excel and easy to implement.
On the other hand, if you have Excel template and want to use that u can use Oledb. Oledb is generally better when reading from excel. It cannot create excel files. You must have a blank excel file to use OleDb.
Interop requires Excel to be installed.
Abhishek Sur
|
|
|
|
|
Abhishek Sur wrote: It cannot create excel files
That's funny, it works for me.
|
|
|
|
|
I'm sorry, how exactly do you go about creating an Excel spreadsheet WITHOUT using interop and just OleDb?
I'm not being sarcastic, it would be of great help. I just can't seem to find it anywhere... All the articles I have found so far say you need to have a spreadsheet to begin with, if you want to transfer data to and from it. (using ONLY OleDb)
var question = (_2b || !(_2b));
|
|
|
|
|
Depending on your lingual preferences
string ConnectionStr = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended properties=\"Excel 8.0;HDR=YES\"", Location);
using (OleDb.OleDbConnection Connection = new OleDb.OleDbConnection(ConnectionStr)) {
Connection.Open();
string CreateString = "CREATE TABLE...";
using (OleDb.OleDbCommand Command = new OleDb.OleDbCommand(CreateString.ToString, Connection)) {
Command.ExecuteNonQuery();
}
Connection.Close();
}
Dim ConnectionStr As String = String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended properties=""Excel 8.0;HDR=YES""", Location)
Using Connection As New OleDb.OleDbConnection(ConnectionStr)
Connection.Open()
Dim CreateString as String= "CREATE TABLE..." 'Create your worksheet using normal SQL
Using Command As New OleDb.OleDbCommand(CreateString.ToString, Connection)
Command.ExecuteNonQuery()
End Using
'More code here
Connection.Close()
End Using
Location is path AND filename
Don't forget to set your permissions at the filelocation if it's a webserver.
|
|
|
|
|
Sweet!
Why did i not know about it before?
Great stuff!!
You're a star
var question = (_2b || !(_2b));
|
|
|
|
|
You're welcome.
Greg Chelstowski wrote: You're a star
|
|
|
|
|
wow... great buddy..
I never thought that it would work.. .my bad ...
Thanks really ... It will solve my all sorts of problems...
you rock
Abhishek Sur
|
|
|
|
|
|
I never thought about it before, but seeing the positive responses I get I think I'll make an article about how to make an Excelexport that doesn't need interop.
|
|
|
|
|
<big> how to put linebreak in notepad using asp.net</big>
|
|
|
|
|
It's hard when your question displays multiple levels of ignorance.
First of all, please help me is not a useful subject, although it does serve as a warning for what is within
Second, notepad cannot interact with ASP.NET. I assume you mean how to put line breaks in a text file ?
Environment.NewLine does that, although it's hard to know exactly what you're asking, and it's for sure that you're in need of reading a basic book on C# or VB.NET ( I am guessing VB ) and ASP.NET.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: It's hard when your question displays multiple levels of ignorance.
Worth for a new sig!
|
|
|
|
|
While Uploading how we can resize and convert it into .Gif format and store it into sql database. while resizing it should not go the clarity, it should get good clarity.
|
|
|
|
|
Robymon wrote: while resizing it should not go the clarity, it should get good clarity.
Well, this is a fantasy. If you resize smaller, you lose detail. If you store as gif, you lose color information, gif is only 8 bit. Within those parameters, you just create a new image, of the size you want, draw the old image into the new one, and save it as a GIF to a stream, which you can then use to get the data for your DB.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
How can i do this. can i get source code of doing this.
|
|
|
|
|
something like:
Bitmap bm = new Bitmap(newWidth, newHeight);
using (Graphics g = Graphics.FromImage(bm))
{
g.InterpolationMode = ??? // I don't recall what enum this is, or the values, set to bicubic if it's offered, or bilinear otherwise.
g.DrawImage(theOriginalImage, 0, 0, theOriginalImage.Width, theOriginalImage.Height, 0, 0, newWidth, newHeight);
}
MemoryStream s = new MemoryStream;
bm.Save(s, ImageType.Gif);
This is all from memory, it almost certainly won't compile, but it's the sort of thing you need to write. Try referring to your textbooks or google for the specifics.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thank you very much. I will try with this code.
|
|
|
|
|
Hi
How i store all Images into applcation Directroy
how i have to give the path while uploading the image
i want to store images like below Path
~\Image1.jpg
Best regrds
Rameez
|
|
|
|
|
What the hell are you talking about ? You can store images at the root if you want to, what's stopping you ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
how to solve this error in sesions
|
|
|
|
|
You seriously think we can help you based on this ? The answer is, check the size of the array before you try to access it, learn to use your debugger, and try to post actual code when you ask for help. If you'd posted code and a real explanation, I'd almost certainly be able to help more.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
i want to create a setup for web based project. as well as i want to know how to configure a database created in sqlserver(in one particular system) to the setup file of that project in another system. It is urgent
|
|
|
|
|
Urgent is a Very String word. refrain from using such words when you post in a Forum because you don't pay us to help you.
You Answer is everywhere in Google. I think this month i have answered this question 8 times in Code Project and other Different Forums. It is wise to google first before you post a question. i think that is a better way to learn. please next time try to google see the results below
http://www.google.co.za/search?hl=en&q=WEB+SETUP+PROJECT+&meta=[^]
Hope it Helps
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
Hi,
Generally a Message Box will have only one button 'OK', how to create more number of buttons like ok,cancel etc.. programiticilly.
Regards,
Arpita
|
|
|
|
|
You can't. You have to create your own popup for that.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|