Click here to Skip to main content
15,889,574 members
Home / Discussions / C#
   

C#

 
GeneralRe: zooming Pin
Eddy Vluggen28-Nov-14 9:19
professionalEddy Vluggen28-Nov-14 9:19 
AnswerRe: zooming Pin
V.27-Nov-14 1:55
professionalV.27-Nov-14 1:55 
QuestionRemove Dynamically Created Controls Pin
Django_Untaken26-Nov-14 1:58
Django_Untaken26-Nov-14 1:58 
AnswerRe: Remove Dynamically Created Controls Pin
OriginalGriff26-Nov-14 2:38
mveOriginalGriff26-Nov-14 2:38 
AnswerRe: Remove Dynamically Created Controls Pin
BillWoodruff26-Nov-14 9:58
professionalBillWoodruff26-Nov-14 9:58 
QuestionImage source BitmapImage update problem Pin
massisoda25-Nov-14 22:40
massisoda25-Nov-14 22:40 
AnswerRe: Image source BitmapImage update problem Pin
M.Scheeren1-Dec-14 22:48
professionalM.Scheeren1-Dec-14 22:48 
Questionhow to retrieve only date from datetime from database Pin
Member 1126447925-Nov-14 18:54
Member 1126447925-Nov-14 18:54 
I have a form in which I have a field date of birth , and a textbox to fill date of birth. When a person fills his date of birth like 01/01/1990, then it will be saved into database and when I retrieve this date form database then this comes 01/01/1990 12:00 AM. I want only date part from it.

This is my form to fillup date of birth
form.aspx
XML
<tr>
     <td width="30%">
        Date of Birth
         <br />
     </td>   <td style="width: 1px">
      :<asp:TextBox ID="txtDateofBirth" runat="server" placeholder="dd/mm/yyyy"></asp:TextBox>
      </td> <td class="td2">


         </td>
         </tr>
This is code for form.aspx.cs
C#
SqlCommand cmd = new SqlCommand("insert into ApplicantForm(NameofApplicant,  dateofbirth)" +
                                                                "values( @NameofApplicant, convert(Datetime, @dateofBirth, 103)", con);

cmd.Parameters.AddWithValue("@dateofBirth",txtDateofBirth.Text);
This is code for print of this date of birth
print.aspx
XML
<asp:Label ID="txtDOB" runat="server"  ></asp:Label>
This is code print.aspx.cs
C#
SqlCommand cmd = new SqlCommand("Select * from ApplicantForm Where ApplicantId=" + ((Request.QueryString["ApplicantId"])) + "", con);

 dr = cmd.ExecuteReader();

txtDOB.Text = dr["dob"].ToString();


modified 26-Nov-14 1:17am.

AnswerRe: how to retrieve only date from datetime from database Pin
Pete O'Hanlon25-Nov-14 19:20
mvePete O'Hanlon25-Nov-14 19:20 
SuggestionRe: how to retrieve only date from datetime from database Pin
Richard Deeming26-Nov-14 1:37
mveRichard Deeming26-Nov-14 1:37 
QuestionWindows mobile App with VS2013 C# Pin
Member 1068390225-Nov-14 8:22
Member 1068390225-Nov-14 8:22 
AnswerRe: Windows mobile App with VS2013 C# Pin
Richard MacCutchan25-Nov-14 22:24
mveRichard MacCutchan25-Nov-14 22:24 
GeneralRe: Windows mobile App with VS2013 C# Pin
Member 1068390226-Nov-14 9:58
Member 1068390226-Nov-14 9:58 
QuestionC sharp Pin
Sarita S24-Nov-14 23:50
Sarita S24-Nov-14 23:50 
AnswerRe: C sharp Pin
den2k8825-Nov-14 0:00
professionalden2k8825-Nov-14 0:00 
GeneralRe: C sharp Pin
Sarita S25-Nov-14 0:10
Sarita S25-Nov-14 0:10 
GeneralRe: C sharp Pin
den2k8825-Nov-14 0:24
professionalden2k8825-Nov-14 0:24 
GeneralRe: C sharp Pin
Nicholas Marty25-Nov-14 0:28
professionalNicholas Marty25-Nov-14 0:28 
GeneralRe: C sharp Pin
Sarita S25-Nov-14 0:35
Sarita S25-Nov-14 0:35 
GeneralRe: C sharp Pin
Eddy Vluggen25-Nov-14 0:20
professionalEddy Vluggen25-Nov-14 0:20 
AnswerRe: C sharp Pin
Eddy Vluggen25-Nov-14 0:21
professionalEddy Vluggen25-Nov-14 0:21 
AnswerRe: C sharp Pin
Simon_Whale25-Nov-14 0:23
Simon_Whale25-Nov-14 0:23 
AnswerRe: C sharp Pin
OriginalGriff25-Nov-14 0:24
mveOriginalGriff25-Nov-14 0:24 
AnswerRe: C sharp Pin
Bernhard Hiller25-Nov-14 5:08
Bernhard Hiller25-Nov-14 5:08 
AnswerRe: C sharp Pin
4a616e25-Nov-14 10:11
4a616e25-Nov-14 10:11 

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.