473,386 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Extracting data from Table2 to TextArea of Table1

I want to designed 2 tables in my aspx page. In table1 there is blank TextArea. In table2 there are button like(First Name,Last Name,Age,DOB) and these attributes are already entered in the database and i have entered corresponding symbols for these attributes (for e.g. for Firstname symbol is {F}, for last name symbol is {L} etc..)... My requirement is when i doubleclick on a button of Table2 (for e.g. FirstName) it will be displayed on TextArea of table1 like (Hi My Name is {F})...
Apr 11 '13 #1
5 1464
pod
298 100+
What have you done so far?
Where do you get stuck?
Have you read this http://bytes.com/topic/asp-net/answe...before-posting

We want to help you, not do the work for you. Ask specific questions, perform small steps, get one button to pop up a msgbox or something in that line, and build on that.

When you get stuck, give us the details.

Good luck

P:oD
Apr 11 '13 #2
I am beginner to asp.net and i am not getting any idea to solve it,thats why am asking for help not to do my whole task.....
Apr 11 '13 #3
pod
298 100+
OK, I understand you are a beginner. So answer my questions:
What have you done so far?
Where do you get stuck?
Apr 15 '13 #4
I ve created an 1staspx page where if i give the first name it will show symbol F in the text area....
Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using System.Data.SqlClient;
  8. using System.Data;
  9. using System.Web.UI.HtmlControls;
  10.  
  11. public partial class Default2 : System.Web.UI.Page
  12. {
  13.     SqlConnection con = new SqlConnection(@"Data Source=AITPLCP72\SQLEXPRESS;Initial Catalog=Template;Integrated Security=True");
  14.     DataSet ds = new DataSet();
  15.     protected void Page_Load(object sender, EventArgs e)
  16.     {
  17.         if (IsPostBack)
  18.         {
  19.             SqlDataAdapter adp = new SqlDataAdapter("select field,Symbols from temp2", con);
  20.             adp.Fill(ds);
  21.         }
  22.     }
  23.  
  24.     protected void btnfn_Click(object sender, EventArgs e)
  25.     {
  26.         Symbol("firstname");
  27.     }
  28.     protected void btnln_Click(object sender, EventArgs e)
  29.     {
  30.         Symbol("lastname");
  31.     }
  32.     protected void btnAge_Click(object sender, EventArgs e)
  33.     {
  34.         Symbol("age");
  35.     }
  36.     protected void btnDOB_Click(object sender, EventArgs e)
  37.     {
  38.         Symbol("dob");
  39.     }
  40.  
  41.     protected void btnsubmit_Click1(object sender, EventArgs e)
  42.     {
  43.         //Session["text"] = TextArea1.InnerText;
  44.         //Response.Redirect("Default3.aspx"); 
  45.         string s = TextArea1.InnerHtml;
  46.         Response.Redirect("http://localhost:2482/Template1/Default3.aspx?text=" + s);
  47.  
  48.     }
  49.  
  50.  
  51.     public void Symbol(string s)
  52.     {
  53.         foreach (DataRow row in ds.Tables[0].Rows)
  54.         {
  55.             if (row[0].ToString() == s.ToString())
  56.             {
  57.                 string st = TextArea1.Value;
  58.                 st += row["Symbols"];
  59.                 TextArea1.Value = st;
  60.             }
  61.         }
  62.     }
  63.  
  64. }
  65.  
  66.  
after that I have created 2aspx page and there i had submit firstname,lastname,age,dob and it extract from db and show in textarea..
Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using System.Data.SqlClient;
  8.  
  9. public partial class Default3 : System.Web.UI.Page
  10. {
  11.     SqlConnection con = new SqlConnection(@"Data Source=AITPLCP72\SQLEXPRESS;Initial Catalog=Template;Integrated Security=True");
  12.     SqlCommand cmd =  new SqlCommand();
  13.     protected void Page_Load(object sender, EventArgs e)
  14.     {
  15.  
  16.     }
  17.     protected void btnsubmit_Click(object sender, EventArgs e)
  18.     {
  19.         string text1 = Request.QueryString["text"];
  20.         //string text1 = TextArea1.InnerHtml;
  21.         text1 = text1.Replace("{F}", txtfn.Text).Replace("{L}", txtln.Text).Replace("{A}", txtage.Text).Replace("{D}", txtdob.Text);
  22.         TextArea1.Value = text1;
  23.     }
  24.  
  25. }  
Apr 16 '13 #5
now i want 2 add repeater to make template in my 2aspx page but how i will do this....
Apr 16 '13 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: c_kubie | last post by:
Ok. Access03 isn't allowing me to import an XLS file. So I imported it into a table. Now I need to take the contents of table one and add it to table two. I'm not very access-literate. So...
0
by: Sunil Basu | last post by:
Hi, I have a interesting thing to know and discuss with you. I am extracting data from an Excel file in a Delphi DbGrid through SQL. I want to create a criteria on a specific cell value of the...
0
by: runner7 | last post by:
I used file_get_contents() to read a pdf into a string and then tried to extract the encoded part between the "stream" and "endstream" words using the strpos() and substr() functions. (I could not...
1
by: oLa.admins | last post by:
Hi folks, I have a textbox with some text in it, and what I am trying to do is when user clicks the 'GO' button, take that text from the textarea and put it into sql database. However I have no...
0
by: sgsiaokia | last post by:
I need help in extracting data from another source file using VBA. I have problems copying the extracted data and format into the required data format. And also, how do i delete the row that is not...
0
by: Hetal | last post by:
Hi.. I am working on VB.NET 2003 (windows form) application and using ADO.NET to deal with databases. The table structure i am working with is as follows. DB1.Table1 (source)...
1
by: JSagar | last post by:
Hello Expert ! I am new to python , i had done 'C' Code , which extracted file data , But i don't want to give my exe On remote side. Following thing is it Possible using python? -...
4
by: poolboi | last post by:
hi guys i've having some problem extracting data from a text file example if i got a text file with infos like: Date 2008-05-01 Time 22-10 Date 2008-05-01 Time 21-00 Date 2008-05-02 Time...
3
by: Tomkat53 | last post by:
Hello, I'm not sure if this has been asked here before (wouldn't know what to search for). Here's my situation... I have records in Table1 that I need to insert into Table2. However, there is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.