Click here to Skip to main content
15,895,799 members

Comments by Brinda Arumugam (Top 16 by date)

Brinda Arumugam 17-Sep-15 3:14am View    
Superb :) thank you its working....
Brinda Arumugam 26-Jul-14 3:55am View    
Date come from datagridview cell

this s my code
<pre lang="c#">
if (e.ColumnIndex == 1)
{
if (dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value == DBNull.Value || dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].FormattedValue.Equals(""))
{ }
else
{
String cleanedString = System.Text.RegularExpressions.Regex.Replace(dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(), @"\s+", " ");
dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = cleanedString.Trim();

if (T.DateValidation(dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) == false)
{
MessageBox.Show("Invalid Date Format!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = "";
}
}
}
</pre>

When i get date from datagridview cell that time only this error occur...
Brinda Arumugam 26-Jul-14 2:50am View    
thanks for reply ...
but i want to validate date in datagridview cell.so we should tell to client whats the format or any other solution for datagridview datetime cell ?
Brinda Arumugam 3-Apr-14 3:56am View    
tnks for fast reply... i got solutions
Brinda Arumugam 3-Apr-14 0:44am View    
checked connection string .its rite. and checked also query its executed and returned data...

this s my coding
DataSet dd = null;
dd = getdatasetfromquery("SELECT DISTINCT P.PNo, P.PDate, P.PM, P.DisAmt, P.NT,P.LT,P.EID,C.EName FROM PurchaseDetails AS P INNER JOIN CustomerDetails AS C ON P.EID = C.EID");

Report_PurchaseAll_View report1 = new Report_PurchaseAll_View();
ConnectionInfo crConnectionInfo;
Tables crTables;
TableLogOnInfo crTableLogOnInfo;
crTables = report1.Database.Tables;
crConnectionInfo = new ConnectionInfo();
crConnectionInfo.ServerName = ValidationT_SQLC.Path;
crConnectionInfo.DatabaseName = ValidationT_SQLC.Name;

foreach (CrystalDecisions.CrystalReports.Engine.Table aTable in crTables)
{
crTableLogOnInfo = aTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
aTable.ApplyLogOnInfo(crTableLogOnInfo);
}
report1.SetDataSource(dd.Tables[0]);
crystalReportViewer1.ReportSource = report1;
crystalReportViewer1.Refresh();

public DataSet getdatasetfromquery(string query)
{
DataSet ds = new DataSet();
cmd = con.CreateCommand();
cmd.CommandText = query.ToString();
cmd.CommandType = CommandType.Text;
da = new SqlCeDataAdapter(cmd);
da.Fill(ds);
return ds;
}