Easy A
Would you like to react to this message? Create an account in a few clicks or log in to continue.


 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

Share
 

 AutoFilling an edit form using C#.NET and SQL

View previous topic View next topic Go down 
AuthorMessage
Corverta
Member
Member
avatar

Posts : 20
Join date : 2011-03-09

AutoFilling an edit form using C#.NET and SQL Empty
PostSubject: AutoFilling an edit form using C#.NET and SQL   AutoFilling an edit form using C#.NET and SQL EmptyWed Jun 29, 2011 7:26 am

Hello fellow Coders,

I am fairly new to ASP.NET, mainly C#.NET and am wondering how I can autofill a form. I know this is extremely vague, because autofilling a form can stretch from textboxes, to dropdowns.

I want help, in particular, with dropdowns, since a drop down is the first thing on my add form(which I want to auto-complete most of and allow the end user to edit...then save)

In general I want to populate a dropdown using a query, but also having one of the values from the dropdown already selected. I have no problem simply populating the dropdown.

Please assist in anyway you can, your help is greatly appreciated!
Thank you again!!
Back to top Go down
CaptainCop
Member
Member
avatar

Posts : 14
Join date : 2011-03-09

AutoFilling an edit form using C#.NET and SQL Empty
PostSubject: Re: AutoFilling an edit form using C#.NET and SQL   AutoFilling an edit form using C#.NET and SQL EmptyWed Jun 29, 2011 7:28 am

In your codebehind (most likely inside the Page_Load), just do something like this:
Code:

.
.
MyDropDownList.SelectedValue = "My Selected Value";
.
.

For a DropDownList control, there are also SelectedIndex and SelectedItem properties you might want to look at. For a TextBox control, the property is Text. Anyway, all you have to do is look for those controls on MSDN - that will answer all such questions.
Back to top Go down
Corverta
Member
Member
avatar

Posts : 20
Join date : 2011-03-09

AutoFilling an edit form using C#.NET and SQL Empty
PostSubject: Re: AutoFilling an edit form using C#.NET and SQL   AutoFilling an edit form using C#.NET and SQL EmptyWed Jun 29, 2011 7:29 am

Yes I am aware of those properties, however, I don't know how to use a query to make it all happen.

Here's some more detail on the question:
I want to run a query that gets an ID (one column one value)

I want to use that value in another query which will get me the value I want to select then use that value to select from a list created using a third query.

Thank you so much for your response, all of the edit pages I have seen do not do this...they just require an unfiltered column :/

Please help me if you can, I really do look forward to hearing form you. If you need anymore clarification let me know
Back to top Go down
Corverta
Member
Member
avatar

Posts : 20
Join date : 2011-03-09

AutoFilling an edit form using C#.NET and SQL Empty
PostSubject: Re: AutoFilling an edit form using C#.NET and SQL   AutoFilling an edit form using C#.NET and SQL EmptyWed Jun 29, 2011 7:30 am

I think the best way to approach my problem is using a query string with more than 1 parameter and then use the selected... operator on the autofill function (automatically inputs data with a said ID) ..

I will post a solution to those who want to see it for future reference (beginners like myself) once I finish this edit form.

Thank you so much for those that viewed this thread
Back to top Go down
Sponsored content




AutoFilling an edit form using C#.NET and SQL Empty
PostSubject: Re: AutoFilling an edit form using C#.NET and SQL   AutoFilling an edit form using C#.NET and SQL Empty

Back to top Go down
 

AutoFilling an edit form using C#.NET and SQL

View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Easy A :: AutoFilling an edit form using C#.NET and SQL Edit-trash Useless :: Trash-