Click here to Skip to main content
15,888,325 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Retaining focus after postback Pin
Jeremy Likness27-Aug-09 6:17
professionalJeremy Likness27-Aug-09 6:17 
GeneralRe: Retaining focus after postback Pin
rcampbell1227-Aug-09 6:33
rcampbell1227-Aug-09 6:33 
GeneralClient side validation is the way to go - Example given Pin
David Mujica27-Aug-09 7:43
David Mujica27-Aug-09 7:43 
Questionupload and download Pin
hasani200727-Aug-09 5:15
hasani200727-Aug-09 5:15 
AnswerRe: upload and download Pin
Abhishek Sur27-Aug-09 5:33
professionalAbhishek Sur27-Aug-09 5:33 
AnswerRe: upload and download Pin
Abhijit Jana27-Aug-09 9:20
professionalAbhijit Jana27-Aug-09 9:20 
GeneralRe: upload and download Pin
Robert_Pan27-Aug-09 14:26
Robert_Pan27-Aug-09 14:26 
QuestionProblem in DateTime conversion!! Please help Pin
skhan1727-Aug-09 4:56
skhan1727-Aug-09 4:56 
Hello,
I am having problem in running query for the following code:

Actually My database in in MS Access and I need to compare the date column (which is in Date format in the database) with the value of the Date textbox (which is a string). So maybe I need to convert the string to date format and then compare......should I convert to date format?

My date is stored in the database as dd-mmm-yy. For example it's stored as 31-Aug-09.

Please assist:

public void executePositiveListQuery_ANY(string selected_Date)
{
string sql;
if(selected_Date=="empty")
sql= "SELECT DISTINCT re_MLNO FROM ml_hiv_status WHERE (re_HIV1_Status=1 AND re_HIV2_Status=1)";
else
{
string selectedDate = (Convert.ToDateTime(selected_Date)).ToShortDateStr ing();// I am having problem here
//DateTime DD= Convert.ToDateTime(selected_Date);
sql= "SELECT re_MLNO FROM ml_hiv_status WHERE ( re_SpecimenDate='" + selectedDate + "' AND re_HIV1_Status=1 AND re_HIV2_Status=1)";
resultsLabel.Text ="You Have selected"+ selectedDate;
}

try
{
OleDbConnection connection = new OleDbConnection(HIV.Database.DataConstants.CONNECT ION_STRING);
OleDbDataAdapter adapter = new OleDbDataAdapter();
OleDbCommand command = new OleDbCommand(sql, connection);

DataSet ds = new DataSet();
adapter.SelectCommand = command;

int count = adapter.Fill(ds);

if (count > 0 && count <= 200)
{
DataView view = ds.Tables[0].DefaultView;
//view.Sort=e.SortExpression;
resultsDatagrid.DataSource = view;
resultsDatagrid.DataBind();
resultsDatagrid.Visible = true;
resultsLabel.Text = count.ToString() + " results found.";
resultsLabel.Visible = true;
exportLinkbutton.Visible = true;
}
else if (count> 200)
{
DataView view = ds.Tables[0].DefaultView;
//view.Sort=e.SortExpression;
resultsDatagrid.DataSource = view;
resultsDatagrid.DataBind();
resultsDatagrid.Visible = false;
resultsLabel.Text = "More than 200 results found. Please Click the Export to Excel Link to Download the Results.";
resultsLabel.Visible = true;
exportLinkbutton.Visible = true;
}
else
{
resultsLabel.Text = "No results found.";
resultsLabel.Visible = true;
exportLinkbutton.Visible = false;
resultsDatagrid.Visible = false;
}
connection.Close();
}
catch(Exception ex)
{
message.InnerHtml = "SQL: " + sql + "<p></p>" + ex.ToString(); //Now it throws exception here!!
}

AnswerRe: Problem in DateTime conversion!! Please help Pin
DoctorMick27-Aug-09 5:01
DoctorMick27-Aug-09 5:01 
GeneralRe: Problem in DateTime conversion!! Please help Pin
skhan1727-Aug-09 5:17
skhan1727-Aug-09 5:17 
GeneralRe: Problem in DateTime conversion!! Please help Pin
Jeremy Likness27-Aug-09 6:18
professionalJeremy Likness27-Aug-09 6:18 
AnswerRe: Problem in DateTime conversion!! Please help Pin
Robert_Pan27-Aug-09 14:24
Robert_Pan27-Aug-09 14:24 
QuestionHTML Input Box Dynamically set default value Pin
dptalt27-Aug-09 3:43
dptalt27-Aug-09 3:43 
AnswerRe: HTML Input Box Dynamically set default value Pin
Coding C#27-Aug-09 4:02
Coding C#27-Aug-09 4:02 
GeneralRe: HTML Input Box Dynamically set default value Pin
dptalt27-Aug-09 4:44
dptalt27-Aug-09 4:44 
GeneralRe: HTML Input Box Dynamically set default value Pin
Coding C#27-Aug-09 21:07
Coding C#27-Aug-09 21:07 
AnswerRe: HTML Input Box Dynamically set default value Pin
Robert_Pan27-Aug-09 14:32
Robert_Pan27-Aug-09 14:32 
GeneralRe: HTML Input Box Dynamically set default value Pin
Robert_Pan27-Aug-09 14:33
Robert_Pan27-Aug-09 14:33 
QuestionCustom Paging Pin
.NET- India 27-Aug-09 3:10
.NET- India 27-Aug-09 3:10 
AnswerRe: Custom Paging Pin
Coding C#27-Aug-09 4:01
Coding C#27-Aug-09 4:01 
GeneralRe: Custom Paging Pin
Coding C#27-Aug-09 4:13
Coding C#27-Aug-09 4:13 
GeneralRe: Custom Paging Pin
.NET- India 27-Aug-09 23:22
.NET- India 27-Aug-09 23:22 
QuestionUsing profile as custom class (getting null while taking data from profile _ Pin
justintimberlake27-Aug-09 1:21
justintimberlake27-Aug-09 1:21 
AnswerRe: Using profile as custom class (getting null while taking data from profile _ Pin
Ibrahim Bello27-Aug-09 1:37
Ibrahim Bello27-Aug-09 1:37 
GeneralRe: Using profile as custom class (getting null while taking data from profile _ Pin
justintimberlake27-Aug-09 1:57
justintimberlake27-Aug-09 1:57 

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.