Click here to Skip to main content
15,914,943 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: WebBrowser control on XP SP2 - permissions? Pin
scootrobertson19-Feb-09 22:14
scootrobertson19-Feb-09 22:14 
Questioncustom task pane in windows application Pin
aashishkrishnan15-Feb-09 18:46
aashishkrishnan15-Feb-09 18:46 
Questioncan Microsoft.Office.Interop.Excel use a existing excel template? [modified] Pin
neodeaths14-Feb-09 21:43
neodeaths14-Feb-09 21:43 
AnswerRe: can Microsoft.Office.Interop.Excel use a existing excel template? Pin
ABitSmart15-Feb-09 0:07
ABitSmart15-Feb-09 0:07 
QuestionRe: can Microsoft.Office.Interop.Excel use a existing excel template? Pin
neodeaths15-Feb-09 0:10
neodeaths15-Feb-09 0:10 
AnswerRe: can Microsoft.Office.Interop.Excel use a existing excel template? Pin
ABitSmart15-Feb-09 0:21
ABitSmart15-Feb-09 0:21 
Questionneed advice on using window form to generate excel data Pin
neodeaths13-Feb-09 0:21
neodeaths13-Feb-09 0:21 
AnswerRe: need advice on using window form to generate excel data Pin
Ashfield13-Feb-09 1:35
Ashfield13-Feb-09 1:35 
This should get you going. You need to add a reference to Microsoft.Office.Interop.Excel



using Excel = Microsoft.Office.Interop.Excel;


OleDbCommand cmd;
using (OleDbConnection con = new OleDbConnection(string.Format("Data Source={0};"   + "Provider=Microsoft.Jet.OLEDB.4.0;" + "Extended Properties=Excel 8.0;", fileName)))
{
    con.Open();
    string sqlToRun = "Create table [test] (Col1 int)";
    string insert = "insert into [test](col1) values (100)";
   
    cmd = new OleDbCommand(sqlToRun, con); // create table (worksheet)
    cmd.ExecuteNonQuery();

    cmd = new OleDbCommand(insert, con); // insert record
    cmd.ExecuteNonQuery();
}


Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP

AnswerRe: need advice on using window form to generate excel data Pin
ABitSmart13-Feb-09 1:36
ABitSmart13-Feb-09 1:36 
QuestionClickOnce problem: 1 solutionfile, 2 windows forms projects Pin
mSh198512-Feb-09 21:56
mSh198512-Feb-09 21:56 
AnswerRe: ClickOnce problem: 1 solutionfile, 2 windows forms projects Pin
Calin Tatar12-Feb-09 22:11
Calin Tatar12-Feb-09 22:11 
GeneralRe: ClickOnce problem: 1 solutionfile, 2 windows forms projects Pin
mSh198512-Feb-09 22:17
mSh198512-Feb-09 22:17 
QuestionHow to close specific windows application when Computer is turned off or is restarted . Pin
Vishnu Nath12-Feb-09 1:23
Vishnu Nath12-Feb-09 1:23 
AnswerRe: How to close specific windows application when Computer is turned off or is restarted . [modified] Pin
Alan N12-Feb-09 4:25
Alan N12-Feb-09 4:25 
GeneralRe: How to close specific windows application when Computer is turned off or is restarted . Pin
Vishnu Nath12-Feb-09 22:16
Vishnu Nath12-Feb-09 22:16 
GeneralRe: How to close specific windows application when Computer is turned off or is restarted . Pin
Eddy Vluggen13-Feb-09 23:56
professionalEddy Vluggen13-Feb-09 23:56 
GeneralRe: How to close specific windows application when Computer is turned off or is restarted . Pin
Vishnu Nath15-Feb-09 18:45
Vishnu Nath15-Feb-09 18:45 
AnswerRe: How to close specific windows application when Computer is turned off or is restarted . Pin
ashok_rgm20-Feb-09 0:07
ashok_rgm20-Feb-09 0:07 
GeneralRe: How to close specific windows application when Computer is turned off or is restarted . Pin
Vishnu Nath20-Feb-09 18:39
Vishnu Nath20-Feb-09 18:39 
Questionhow do i add values to listbox programmically? [modified] Pin
neodeaths11-Feb-09 22:59
neodeaths11-Feb-09 22:59 
AnswerRe: how do i add values to listbox programmically? Pin
Alan N12-Feb-09 1:20
Alan N12-Feb-09 1:20 
QuestionRe: how do i add values to listbox programmically? Pin
neodeaths12-Feb-09 1:51
neodeaths12-Feb-09 1:51 
AnswerRe: how do i add values to listbox programmically? Pin
Alan N12-Feb-09 3:35
Alan N12-Feb-09 3:35 
GeneralRe: how do i add values to listbox programmically? Pin
neodeaths12-Feb-09 3:42
neodeaths12-Feb-09 3:42 
GeneralRe: how do i add values to listbox programmically? Pin
Alan N12-Feb-09 3:58
Alan N12-Feb-09 3:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.