Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<asp:GridView ID="GridView1" class="gridview" runat="server"
            AutoGenerateColumns="false" onrowcreated="GridView1_RowCreated">
        <columns>
        <asp:TemplateField HeaderText="ID">
        <ItemTemplate>
          <asp:Label ID="Lid" runat="server" Text='<% #Eval("id") %>'/>
         </ItemTemplate>
        </asp:TemplateField>

        <asp:TemplateField  HeaderText="NAME">
        <ItemTemplate>
          <asp:Label ID="Lname" runat="server" Text='<% #Eval("name") %>' />
          </ItemTemplate>
        </asp:TemplateField>

 <asp:TemplateField  HeaderText="DATE">
        <ItemTemplate>
          <asp:Label ID="Ldate" runat="server" Text='<% #Eval("date") %>' /></ItemTemplate>
        </asp:TemplateField>

        <asp:TemplateField  HeaderText="DATE">
        <ItemTemplate>
           <asp:LinkButton ID="LinkButton1" runat="server" Text="Edit" CommandName="EDIT"/></ItemTemplate>
        </asp:TemplateField>

<asp:TemplateField >
        <ItemTemplate>
          <asp:LinkButton ID="LinkButton1" runat="server" Text="Delete" CommandName="DELETE"/></ItemTemplate>
        </asp:TemplateField>


        </columns>
        </asp:GridView>




this is my code for insert button..
protected void Button1_Click(object sender, EventArgs e)
{
string name = TextBox2.Text;
System.Globalization.CultureInfo cultureinfo =new System.Globalization.CultureInfo("nl-NL");
DateTime date = DateTime.Parse(DateTime, cultureinfo);
cmd.CommandText=@"insert into cultureinfo(name,date)values(@name,@date)";
cmd.Parameters.AddWithValue(@name, name);
cmd.Parameters.AddWithValue(@date, date);
cmd.ExecuteNonQuery();
cmd.Connection = conn;
conn.Open();
conn.Close();
gvbind();


}
Posted
Comments
OriginalGriff 30-May-15 5:32am    
And?
The problem is?
Arasappan 30-May-15 5:43am    
the code is not working sir.. what can i do now
Sergey Alexandrovich Kryukov 30-May-15 5:47am    
"Not working" is not informative.
—SA
Arasappan 30-May-15 5:52am    
can you please give the informative logic to create datetime value.
Sergey Alexandrovich Kryukov 30-May-15 6:22am    
To create? It could be used in one of Parse* or TryParse* methods.
—SA

1 solution

 
Share this answer
 
Comments
OriginalGriff 30-May-15 6:04am    
Reason for my vote of one: This is not an answer, and you know it!
If it was, you wouldn't have followed it up with the comment:
'"Not working" is not informative.'
That's just background stuff with no direct relation to the OP problem.
Sergey Alexandrovich Kryukov 30-May-15 6:13am    
Thank you for your opinion. This is certainly not an answer, because the question was not a correct question.
But the confusion seems to be clear to me. This is how culture is used in this type; and I doubt that it can be used in any other way. And your reference to my comment is ridiculous. Yes, it is not informative, so what?

So, no matter how you vote, I won't remove this post, because I hope it can be useful. It is more important that "answer" or "not an answer". I think that's why our inquirer accepted it.

For comparison, look at your own post: http://www.codeproject.com/Answers/996355/i-dont-understand-what-is-the-error#answer1.

This is exactly the same thing, even less of the answer (because original post is not a question, so not clear what you are answering to), this is also "background information", in the form of some code sample; and I hope it can be useful as well.

Thank you.

—SA
Arasappan 30-May-15 6:28am    
I am new to programming. in future u will modify my mistakes..
Sergey Alexandrovich Kryukov 30-May-15 21:53pm    
Sure.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900