473,396 Members | 2,068 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,396 software developers and data experts.

How to accomplish this programmatically - ASP.Net

geo039
47
Here's what I need to do, I have two tables bldgloc (bldg_id, bldg_desc) and roomloc (room_id, room_num, bldg_id). I am trying to build a maintenance screen so that the user can add a bldg or a room. I picture the user selecting the bldg from a list which would then populate all the rooms. When they add room it should be added to the id of the bldg selected.

I'm a beginner and have tried a few things with gridview but can't seem to get things to work.

I am hoping you guys can give me suggestions on how (in the simplest way possible) I could accomplish the above.

Thanks
Aug 22 '07 #1
3 1218
nateraaaa
663 Expert 512MB
Here's what I need to do, I have two tables bldgloc (bldg_id, bldg_desc) and roomloc (room_id, room_num, bldg_id). I am trying to build a maintenance screen so that the user can add a bldg or a room. I picture the user selecting the bldg from a list which would then populate all the rooms. When they add room it should be added to the id of the bldg selected.

I'm a beginner and have tried a few things with gridview but can't seem to get things to work.

I am hoping you guys can give me suggestions on how (in the simplest way possible) I could accomplish the above.

Thanks
I would recommend giving the user a drop down list with the building ids. Then allow them to search for the rooms within that building by clicking a search button. Display the results in a gridview. On your gridview you will want to add a Button that will allow you to enter a new room for the building. There are several ways that you can do this.
1. You can redirect or pop up a new page that will allow the user to enter the data for the new room and save (call insert stored procedure).
2. You can allow the user to add the new room within the grid view. See example .

Make sure that you rebind the gridview after the new data has been inserted into the database.

Nathan
Aug 22 '07 #2
geo039
47
Actually I have that page you showed built for the rooms updating, I just got stuck on some of the C# syntax since i'm in VB but switched gears to work on the grid for bldgs. I am working on this one http://www.gridviewguy.com/ArticleDetails.aspx?articleID=98

However, I don't know how to handle the fact that bldg_id can't be null. I keep getting record cannot be added because nulls aren't allowed??
Aug 22 '07 #3
nateraaaa
663 Expert 512MB
Actually I have that page you showed built for the rooms updating, I just got stuck on some of the C# syntax since i'm in VB but switched gears to work on the grid for bldgs. I am working on this one http://www.gridviewguy.com/ArticleDetails.aspx?articleID=98

However, I don't know how to handle the fact that bldg_id can't be null. I keep getting record cannot be added because nulls aren't allowed??
Your insert proc should have some type of IDENTITY column that automatically creates the next bldg_id for a new row. Is there something like this in the insert proc?

Nathan
Aug 22 '07 #4

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

Similar topics

1
by: Yasutaka Ito | last post by:
Hi, Given an object, I want to programmatically monitor it for any property changes and method calls. The object can be anything (component, control, etc.), and there is no guarantee that each...
2
by: Prakash Wadhwani | last post by:
I have an Access Database called "TEMP" On Opening the "TEMP" Database, I need to use VBA (programmatically): a) to connect to another database called "PMF" b) the PMF database requires a...
1
by: Jay | last post by:
I'm wondering if anyone has even encountered a control or other scripting that will automatically rotate the rows of a datagrid... I am in the process of building an asp.net application that will...
6
by: Matt Frame | last post by:
I have a client that has asked us to get a digital signature certificate and start digitally signing all files we pass between each other. I have heard of the subject and know about the certs but...
1
by: BobAchgill | last post by:
When I try to change the Color.Lime with a string that contains the contents "Color.Lime" I get a Casting compile error. So how can I get past this casting issue to change out the color...
2
by: jeffmagill | last post by:
Hi everyone! As the title says, I'm to access the default culture for the browser at run time. Furthermore as some side notes, my application's goal is to accomplish this at the application...
1
by: ianicbass | last post by:
In deploying SQL Express, how do I create a new server (INSTANCENAME) programmatically? What would be the best approach to accomplish this. Thank you so much,
2
by: steggun | last post by:
Hello, I'm writing a C# windows form application and need some guidance on a couple of issues. First, my application needs to change the permissions on a folder. The application creates a...
2
by: Charles Calvert | last post by:
I've checked the Google Groups archives and the web and not found the answer, though I've found hints that it's possible. How can I programmatically change the color scheme on Windows XP? I...
0
by: Scal | last post by:
Hello everyone; I try to create a web user control that has a Repeater (not that hard) to which I can add programmatically a new Repeater into ItemTemplate part. The point being to be able to...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.