Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 2nd, 2006, 06:41 AM
Registered User
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to venkatmakkena
Default how to get texboxes data & added from table dynami

private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here

            for(int i=0;i<5;i++)
            {
                Table t1=new Table();
                TextBox t=new TextBox();
                Table1.Parent.Controls.Add(t);
                TableRow tr=new TableRow();
                TableCell tc=new TableCell();
                Table1.Rows.Add(tr);
                tr.Cells.Add(tc);
                tc.Controls.Add(t);
                //t.ID="t1";
            }

        }


private void LinkButton1_Click(object sender, System.EventArgs e)
        {

            index=int.Parse(h.Value);
            if(index>=0)
            {
                for(int i=0;i<=index;i++)
                {
                    TextBox t=new TextBox();
                    TableRow tr=new TableRow();
                    TableCell tc=new TableCell();
                    Table1.Rows.Add(tr);
                    tr.Cells.Add(tc);
                    tc.Controls.Add(t);
                    t.ID="textbox"+i.ToString();
                    t.ToolTip=t.ID;
                    h2.Value=t.ID;
                    String s=t.Text;
                }
                index=index+1;
                h.Value=index.ToString();

                //Response.Write(h2.Value);
            }

        }


private void Button1_Click(object sender, System.EventArgs e)
        {
            String a=0;
            t.text=a;


        //Response.Write(h2.Value);
        index=int.Parse(h.Value);
        for(int i=0;i<index;i++)
        {
SqlConnection cn=new SqlConnection("user id=sa;password=;data source=econduit2;initial catalog=pubs");
            cn.Open();
SqlCommand cmd=new SqlCommand("insert into dynamic(name)values(@nam)",cn);
SqlParameter p1;
p1=cmd.Parameters.Add(new SqlParameter("@nam",SqlDbType.VarChar));
            p1.Value=t.Text;
            cmd.ExecuteNonQuery();
            Response.Write(index);
        }
        }









How to added data of the textboxes into database field

please send code anyone

venkat





Similar Threads
Thread Thread Starter Forum Replies Last Post
I added a column to a table, but, I can't see it. furjaw SQL Language 1 July 3rd, 2007 09:24 PM
Data updating in Table & reflecting in report anukagni Access 5 May 31st, 2006 03:57 AM
Added new search field & showing no results?? jdavis7453 Classic ASP Databases 0 September 16th, 2004 05:05 PM
how to added a calculated field in pivot table ndenhere BOOK: Access 2003 VBA Programmer's Reference 0 May 27th, 2004 02:45 AM
sql & join tables & find a field in multiple table trangd Beginning PHP 2 January 29th, 2004 07:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.