Click here to Skip to main content
15,893,487 members
Home / Discussions / C#
   

C#

 
GeneralRe: track bar int too double ? Pin
stephen woolhead10-Jan-03 15:32
stephen woolhead10-Jan-03 15:32 
GeneralRe: track bar int too double ? Pin
David Stone11-Jan-03 5:58
sitebuilderDavid Stone11-Jan-03 5:58 
GeneralAborting updates in a DataTable Pin
stephen woolhead10-Jan-03 12:43
stephen woolhead10-Jan-03 12:43 
GeneralRe: Aborting updates in a DataTable Pin
jtmtv1810-Jan-03 13:28
jtmtv1810-Jan-03 13:28 
GeneralRe: Aborting updates in a DataTable Pin
stephen woolhead10-Jan-03 13:57
stephen woolhead10-Jan-03 13:57 
GeneralRe: Aborting updates in a DataTable Pin
jtmtv1810-Jan-03 14:19
jtmtv1810-Jan-03 14:19 
GeneralRe: Aborting updates in a DataTable Pin
stephen woolhead10-Jan-03 15:42
stephen woolhead10-Jan-03 15:42 
GeneralVersion number in deployment app Pin
Bog10-Jan-03 12:24
Bog10-Jan-03 12:24 
QuestionMDI apps fullscreen without border? Pin
capiscan10-Jan-03 11:53
susscapiscan10-Jan-03 11:53 
GeneralRubber band drawing in GDI+ Pin
Jojje10-Jan-03 7:53
Jojje10-Jan-03 7:53 
GeneralRe: Rubber band drawing in GDI+ Pin
stephen woolhead10-Jan-03 13:11
stephen woolhead10-Jan-03 13:11 
GeneralRe: Rubber band drawing in GDI+ Pin
Jojje11-Jan-03 1:18
Jojje11-Jan-03 1:18 
GeneralFind & Copy part of string Pin
Steve McLenithan10-Jan-03 6:52
Steve McLenithan10-Jan-03 6:52 
GeneralRe: Find & Copy part of string Pin
leppie10-Jan-03 6:59
leppie10-Jan-03 6:59 
GeneralRe: Find & Copy part of string Pin
Steve McLenithan10-Jan-03 7:02
Steve McLenithan10-Jan-03 7:02 
Generaldelegate ordering Pin
Shaun Wilde10-Jan-03 5:15
Shaun Wilde10-Jan-03 5:15 
GeneralRe: delegate ordering Pin
Nick Parker10-Jan-03 5:58
protectorNick Parker10-Jan-03 5:58 
GeneralRe: delegate ordering Pin
Shaun Wilde10-Jan-03 6:06
Shaun Wilde10-Jan-03 6:06 
GeneralRe: delegate ordering Pin
leppie10-Jan-03 6:07
leppie10-Jan-03 6:07 
GeneralExport to Excel Problem Pin
Jassim Rahma10-Jan-03 0:10
Jassim Rahma10-Jan-03 0:10 
I'm using the following code to export from a database to Microsoft Excel but I have one problem: The first record in the database is not getting exported correctly, any one can tell me why?

Many Thanks,
Jassim Rahma


string myConnString = ConnectionString;

OdbcConnection cn = new OdbcConnection(myConnString);
cn.Open();
cn.ChangeDatabase(TableName);

DataSet ds = new DataSet();
OdbcDataAdapter da = new OdbcDataAdapter(SQLstatement, cn);

da.Fill(ds, TableName);

if (MessageBox.Show("Do you want to Export the data?", "Export", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{

string MyString;

StreamWriter myTextStream = new StreamWriter(txtOutput.Text);

for (int i= 0; i < ds.Tables[0].Columns.Count-2; i++)
{
MyString = ds.Tables[0].Columns[i].ToString() + ", ";
}

MyString = ds.Tables[0].Columns[ds.Tables[0].Columns.Count-1].ToString();

myTextStream.WriteLine(MyString);
MyString = "";

System.Data.DataTable tb = ds.Tables[0];

for (int i = 0; i < tb.Rows.Count-1; i++)
{
System.Data.DataRow dr = tb.Rows[i];
for (int j = 0; j < dr.Table.Columns.Count-2; j++)
{
MyString = MyString + dr[j].ToString() + ", ";
}
MyString = MyString + dr[dr.Table.Columns.Count-1].ToString();
myTextStream.WriteLine(MyString);
MyString = "";
}

myTextStream.Close();
myTextStream = null;

Process p = new Process();
System.Diagnostics.ProcessStartInfo pi = new ProcessStartInfo();
pi.UseShellExecute = true;
pi.WindowStyle = ProcessWindowStyle.Hidden;
pi.FileName= txtOutput.Text;
p.StartInfo = pi;
p.Start();
}

cn.Close();
cn.Close();
}

Jassim Rahma
GeneralCommandbars Pin
suresh_sathya9-Jan-03 20:18
suresh_sathya9-Jan-03 20:18 
QuestionInclude Dll's in Build? Pin
granthnk9-Jan-03 16:54
granthnk9-Jan-03 16:54 
AnswerRe: Include Dll's in Build? Pin
Stephane Rodriguez.9-Jan-03 21:09
Stephane Rodriguez.9-Jan-03 21:09 
QuestionHow to get control reference from handle? Pin
FruitBatInShades9-Jan-03 14:01
FruitBatInShades9-Jan-03 14:01 
AnswerRe: How to get control reference from handle? Pin
leppie9-Jan-03 20:51
leppie9-Jan-03 20:51 

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.