Database table to formview to other table

Okay here's my situation I'm trying to make a page that the user is presented witha a single text box. This text box would be used to entering problems, complaints, etc. Apon Pressing insert there is a number of other fields that would be hidden that would be used to create a complete ticket to be written to a ticket database, this information would be pulled from a USer database using the User's login...

Where I'm at...

I currently am Using a Select statement for my User table, and an Insert Statement for my Tickets table.

They are both in the same datasource and using User.Identity.Name to determine the login name. (this is working) In my Item Template All the hidden fields (which I've not hidden yet) are filling in correctly leaving the Request field blank as I've added a column is in the User table but set to Null only. (I'm sure there is a better way) but never the less it populates fine. If I use insert command here it Throws up and says you need to be in insert mode, Now if the Insert Template (using the exact same code to the character) It inserts perfectly fine, however; doesn't populate the fields from the User Table. So I have the proper functionality on both ends, however, not getting them to play together. Really all I need is the fields First, Last, Department, and extension to be pulled the User table where User = @User meaning I only get the correct record (or null) and when I push insert below my request textbox it takes that information and inserts it into my ticket table...

 Any ideas?

(Next step after this would be make it so if the Username isn't found in my Usertable it would forward the user to a different URL, however; first I need the above before I worry about registration processes.)


The delete key... A programmer's Sledge hammer.
0
MetalIce
3/6/2008 7:59:37 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

2 Replies
877 Views

Similar Articles

[PageSpeed] 1

Hi MetaIce:

           I have some suggestion and hope it can help.

  1. To the Insert button event, add the code: FormView1.ChangeMode(FormViewMode.Insert);
  2. I think you can can write some codes to insert information to your ticket table. These codes should be written in Insert button event too. First check the user name to see whether it exists in user table. If not, redirect. If it exists, do insert. Please see the link below. It shows you a simple example:

          (FindControl in FormView)http://rezzed.com/tag/aspnet/

          (ADO.NET Operation)http://www.csharpfriends.com/Forums/ShowPost.aspx?PostID=29132

          Hope my suggestion helps. Thank you.

Karl


Click "Mark as Answer" on the post if the answers help

Click "Unmark as Answer" if you need more direction

Thank you for your cooperation
0
Karl
3/9/2008 3:29:46 AM

I see the command you want me to add however I'm not sure how exactly to enter it here is my insert button...

<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" ValidationGroup="InsertValidationControls" CommandName="Insert" Text="Insert" />

The only code behind involved in that button is an oninserting event, however; I cannot use the code mentioned in that event... How should I address this?


The delete key... A programmer's Sledge hammer.
0
MetalIce
3/10/2008 3:09:09 PM
Reply:

Similar Artilces:

How to add the data present in the controls to a table control without any database involvement.
Hi All,i am four controls where i will write the text and once i click the add button those should get added to the table .i want 6 columns fixed in the table and rows as many as required.i tried doing that taking a table server control and able to load the table.but the problem is whenver i am adding a new row the old one is gfetting overwritten by this and at the end i am getting only one row.  System.Web.UI.WebControls.Table t1 = new System.Web.UI.WebControls.Table();  i have declared the below one global TableRow tr; TableCell tc1; TableCell tc2; TableCell tc...

masterpage and control formatting (table control, HTML table control)
I have a master page that contains 1 contentplaceholder.  In my default.aspx (that uses the masterpage layout) I have a table server control.  During page_load I get the data I need and repeatedly add the usercontrol to the table control, one user control per row.  My user control is basically a HTML table with several rows and columns that's populated with data upon creation. I want this table to fill the contentplaceholder's width. In addition within the masterpage I have a CSS link for my stylesheet. Here are my questions: Is there a better way of adding ...

Table within formview bound to different database table
Hi,    How do I bind the textbox placed in a formview to a different table(say table Y) of the database1? My formview's sqldatasource is bound to table X of database1. How do I get the fields of table Y to be displayed along with the fields of table X ? Experts please help! Somebody please help me!! If you want i'll paste my code too....please help! Hi guha:           You can try left join to get one view from the two tables, just like:           select * from tableX left j...

Tables?! Why Tables?!
Bit random...but why does everything have to be rendered as a table?  It's starting to get quite annoying.  Formview - does this need to be a table?  the Menu??  Wouldn't it make sense to allow the option to...say...not render a Menu as a table?  Am I the only one that thinks this or are there others?  www.internetgeeks.co.ukwww.norwichbookclub.co.uk You can use CSS Adapters to create your own adapters to override how the controls render it self. In the next version of ASP.Net, you will probably have more flexibility to specify the surrounding elements of th...

From Table to Table
I am working in Delphi 4 and ran into a roadblock I am unfamiliar with. I am trying to search and find values in one table based off of matching values in another. For example a table of objects with fields like name, description, type, ect; and a table of object properties in which each object can be represented multiple times based on the settings on the page at the time. So if i search the object property table (and eventually loop through to repeat for all objects) to find all cases of visible objects when a certain criteria is met. It stops on the first object with "Yes" in th...

Can I use a single database both for the tables created automatically for Login Control and my own tables
Can I have a single database containing both set of tables i.e. Tables, stored procedures created automatically after configuring  ASP.Net Configuration My own tables Because I want to authenticate the users through Login Controls, but also want to fetch data from my own tables. How should i Configure the web.config file to make a connection to the database before the user is authenticated. How should I access the connection string so that I can fetch the data and display it on the same page where the Login Control has been placed.Akber Ali Using a single database is no differe...

Database tables and lookup up tables?
Ok say I would like to build a table for of the following questions(say 6 questions for the sake of argument): Do I just stored the index of the radiobuttonlist. What are some resources that I could look at. Should I make a look up table. 5) If money were no object, I would live . . . Prefer not to say On a tropical island In a New York penthouse In an English castle On a Texas ranch In a Malibu beach house In a mountain retreat (Selected) On the moon None of the above 1 ---> 2 ---> 3 ---> 4 ---> 5) --->6 ...

Link FoxPro Database table to SQL Server Database table
I have LAN Server in witch Visual Foxpro Database reside.I have another remote server in witch SQL Server 2005 installed.I want to link Foxpro table to SQL Server Database Table.Is it possible? Can please someone help? Thanks MS...

Convert a html table control to a Table Web Server Control
How Convert a html table control to a Table Web Server Control? add runat="server" attribute to the <table> tag...

a little help with transfering table A in Database A into table B in database B
I can't seem to find a good tutorial in transfering data from one table in database a into a different table in database b. The catch is that the fields in the tables don't match exactly. How can I do this? Examples, tutorials, etc are greatly appreciated.Thanks!Graphfixz Data & Web Designhttp://www.graphfixz.com All you need is INSERT INTO with column list that will give you control of how you the the insert into the new database, the other option was to use DTS.  Try the link below for the INSERT INTO statement.  Hope this helps.http://msdn.microsoft.com/library/def...

Showing table columns from multiple tables in Formview, but insert/update/delete rows of Master table
I have a page on which I have GridView and FomView control. On selection of a row in GridView the row gets displayed in the Item template of the FormVIew. The values are the result of inner join from multiple tables i.e. table Stock,Product and Workshop.  Please let me know how I could insert/update/delete data for the base table i.e. Stock table, but be able to see the column values from the associated tables on the Itemtemplate,Edittemplate and Inserttemplate of the FormView. Thanks,Anita Hi:   Take a look at this tutorial. It's for DetailsView and same ...

HTML Table or Web Control Table?
Hi, I am wondering what is the purpose of using Table web control? It seems to me kind of hard to just drag and drop a textbox or other web controls in the table ... unlike HTML table, we can drag a web controls and just drop it inside the HTML table cell ...? Is there any good tutorial for just how to use the Table control?? There is Microsoft tutorial for table control, is there any others site? I assume you are talking about a data control such as a data grid, data list, or repeater. Try these artciles.... http://aspnet.4guysfromrolla.com/articles/052103-1.aspx http://msdn.micr...

alter table of table A causes trigger on table B accesseng table A to fail
hi, i recently faced a strange problem, i have two tables, table A and table B table A has a update trigger which updates data in table B. i altered table B to add two more columns. after which when i updated table A(modifying 1 row), my tran log got full. there was a threshold proc which got fired but it did'nt help much. i though the tables had been corrupted. ran dbcc tablealloc on syslogs, table A, table B, no errors. Just to be sure I ran a dbcc checkdb, checkalloc and checkcatalog - no errors i recreated the trigger - no use. dropped the trigger. updated the table it ...

Insert controls into a table cell? (Table managment)
Hi. I can not manage to drag and drop web-controls into a single table cell? I am currently designing a registration form where I want to have f.e. a textbox inside a table cell. Is this possible at all or do I have to insert/manage the asp:textbox by using the code editor? I noticed Dreamweaver MX had the feature to select each cell (really create table control actually) individually, but that was a regular form. DWMX have ASP.NET support but only a few basic web-controls. I really want to use WebMatrix so a solution for this is really wanted! Thanks. Have you tried using t...

Web resources about - Database table to formview to other table - asp.net.presentation-controls

Database - Wikipedia, the free encyclopedia
... requiring information. For example, modelling the availability of rooms in hotels in a way that supports finding a hotel with vacancies. Database ...

Database - Wikipedia, the free encyclopedia
A database is an organized collection of data . The data are typically organized to model aspects of reality in a way that supports processes ...

Five million customers affected by Vtech database hack
Toy and educational material seller Vtech has revealed five million customers were affected by a hack of its app database and has also suspended ...

IDG Contributor Network: Avoiding ginormous transaction logs with SharePoint databases
... why do we see these humongous transaction logs so often? I am going to blame it on a “misunderstanding” of how Microsoft describes a full database ...

Trump Wants A Database For All Syrian Refugees Who Enter America
Trump Wants A Database For All Syrian Refugees Who Enter America

Change your passwords: NexusMods suffers database breach
... security breach by posts on reddit. Cybersecurity firm REN-ISAC had apparently contacted several university IT departments about a database ...

EFF confirms that the DEA has deleted its phone call database
Earlier this year, it was revealed that the NSA's massive surveillance program had a precursor: the Drug Enforcement Administration's USTO, which ...

VTech Admits Lack of Database Security Opened Door to Hack
A SQL injection, a common software flaw, was found to be the root cause in the VTech breach.

MapR And Big Data In The World's Largest Biometric Database Project
India?s Aadhaar project is one of the world?s most ambitious big data projects, aiming to collect, store, and utilize biometric information from ...

Trump calls for surveillance of some mosques, attempts to clarify remarks on Syrian database
Trump calls for surveillance of some mosques, attempts to clarify remarks on Syrian database

Resources last updated: 12/16/2015 5:57:26 PM