Click here to Skip to main content
15,896,118 members

Comments by shunuman (Top 10 by date)

shunuman 25-Jul-13 4:29am View    
Table data like 7/15/2013 2:45:00 PM and I need 2:45 PM
I am getting gata from table and write it text file, my code is like..

SqlDataAdapter sdr = new SqlDataAdapter("select * from currentdata", santosh.destination);
DataSet ds = new DataSet();
sdr.Fill(ds, "currentdata");
DataTable dt = new DataTable();
dt = ds.Tables[0];
int Rowcount = dt.Rows.Count;
TextWriter twr = new StreamWriter(@"D:\TIDS.txt");
int RowPos = 0;
while (Rowcount > 0)
{
twr.WriteLine("");
twr.Write("STA=" + dt.Rows[RowPos].ItemArray[4];// I want to convert this value in 2:45 PM
RowPos++;
Rowcount--;

}
twr.Close();
}
shunuman 25-Jul-13 4:27am View    
Table data like 7/15/2013 2:45:00 PM and I need 2:45 PM
I am getting gata from table and write it text file, my code is like..

SqlDataAdapter sdr = new SqlDataAdapter("select * from currentdata", santosh.destination);
DataSet ds = new DataSet();
sdr.Fill(ds, "currentdata");
DataTable dt = new DataTable();
dt = ds.Tables[0];
int Rowcount = dt.Rows.Count;
TextWriter twr = new StreamWriter(@"D:\TIDS.txt");
int RowPos = 0;
while (Rowcount > 0)
{
twr.WriteLine("");
twr.Write("STA=" + dt.Rows[RowPos].ItemArray[4];// I want to convert this value in 2:45 PM
RowPos++;
Rowcount--;

}
twr.Close();
}
shunuman 25-Jul-13 4:18am View    
If I put my table instead of RcvDate then show 0 value.
shunuman 25-Jul-13 4:16am View    
Sorry, it shows Invalid column name 'RcvDate'.
shunuman 25-Jul-13 4:14am View    
Sorry, it's not working.