|
I don't want to see your code buddy. I want the business case.
|
|
|
|
|
im having around 30 checkboxes in page i used datalist to display.
when check boxs checked i need to insert their names into one column(seperated by comma or space)
then when i get those values from db check boxs need to be checked(edit mode)...
|
|
|
|
|
What is the condition that dictates that you need 30 check boxes? Do you create the checkboxes at runtime or are they available at design time itself? I suppose you create them at runtime. If so, from where do you get their names i.e. the text for each checkbox? Are these text values unique?
|
|
|
|
|
design time
Dinesh Mani wrote: If so, from where do you get their names i.e.
text of check box is a column from db using datalist.. all values are unique..
|
|
|
|
|
If you already have the text in the table, then why do you want to save it again the db? I understand that you need to save the state but why save the text?? What is the relevance of these checkboxes to the rest of the screen? i.e. is the state common across users or each user gets his/her own set of checkboxes? When you save the state to the DB what is the reference that you would be using to retrive it??
|
|
|
|
|
all users is having the same textboxes..
Dinesh Mani wrote: why do you want to save it again the db?
Im saving it to a different table so i used text to insert into new table..
Response.Write(ck.Text + "<br/>");
with this i can get multiple checked text values but how do i insert into db.
saving state or text whatever it may be i need to retrive them from db
but my sir wants text..
|
|
|
|
|
Ok I'm not getting why you need to do it this way so here you go.
pseudo -
Declare string CheckedBoxesText --- Use a stringbuilder
For each check box in datalist
if Checkbox is checked
Add concatenate checkbox text to CheckedBoxesText
else
do nothing
End of Foreach Loop
Query = "insert into test(test1) values('"CheckedBoxesText"')";
Execute query.
Implementing this pseudo would enable you to save the "text" of your check boxes to the db.
|
|
|
|
|
Remove the break; statement from the For each loop.
|
|
|
|
|
The break; statement will move you out of the loop once First data is inserted.
Just for your knowledge, google it and you will find what for break is used.
So, remove the break statement from if block then all your checked records will be inserted to the database.
|
|
|
|
|
i removed break but still im able to insert only last checked value..
|
|
|
|
|
What is the use break in if block? Cheers!!
Brij
|
|
|
|
|
initially i used a label to check
if break is not used i need to check all check boxes for label to true and viceversa
|
|
|
|
|
See your variable str13 is not associated to the every item/checkbox in datalist so it will alyas be the latest.
Regarding the checkbox, try to debug the the code whether you arre able to access all the checkbox in the datalist and their associated values.If you are able to get the checkbox's value specifically then why they are not getting inserted.
One reason I can think of your row might be getting updated everytime so thats you are getting the latest one.Verify it.
Also
test-09 wrote: "insert into test(test1) values('"+ck.Text+"')";
you checkbox is chk not ck. Cheers!!
Brij
|
|
|
|
|
Thank you bros.. you people guide me well
I got exactly what i want...
|
|
|
|
|
Hi,
I m developing a project on parking system. I need to know how to make an entry to the session log table when an user logs in and how to remove the session when he logs out. and also when the user adds,deletes or updates an entry should be made in the event table. Pls help me out
|
|
|
|
|
|
Ok guys before you say this question has been asked before the problem is that
try<br />
{<br />
mail.Send(blah)
}<br />
catch(SmtpFailedRecipientsException ex)<br />
{<br />
}<br />
Microsofts example are pretty straight forward and if you go by the example the above should work bit it does NOT...theLizard
|
|
|
|
|
I have been looking into search indexing, and its a bit out of my depth. I have searched around plenty of forums and sites looking for answers.
I am trying to index my site locally so that when a user adds new content this shall get indexed along with the rest of the content.
If anyone knows of any good articles or even tutorials to help me accomplish my task I would be most thankful.
Once i have succeeded I will publish the results on the site so that others wishing to accomplish the task and modify the code to thier requirements may do so.
ThanksASP all the way
|
|
|
|
|
Hi
In my application, I am using ODP.Net in conjunction with my MVC design pattern, what is happening is that my application is not handing back the connections back to the pool, even with all the properties set in the connection pool. The application is using Dispose from IDispose, which I set in the unload method of my aspx page. In debug, this method is being hit every time, but even with this, and looking in SQL Plus at v$session table, the connections are still open and not closed. If I refresh the page all I am seeing are more connections being opened until the application crashes out. What is going on? Can anyone help?
|
|
|
|
|
Without seeing any of the code it's very difficult to tell you were you may have gone wrong or what is happening.
You shouldn't rely on the unload event to dispose of your connections. The data access shouldn't be bound to the presentation. You can wrap the calls in a using statement. Remember, especially with web, the connections should be opened as late as possible and closed as soon as possible. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I have an editable gridview with blank cells. User enters some numeric data in cells and also user can clicks a button to add new row to gridview. My problem is that, as soon as button click event is fired, the page refreshes & the gridview becomes empty. Can anybody tell me, how can I save values in gridview until the user saves all changes to the server in the end
|
|
|
|
|
Look at the section on Edit Mode, DataGridDemo[^]
Store the values entered in a datasource, such as a datatable that is bound to the grid. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
How is it possible to change the database which the login control is using based on the selection of the database name from a dropdown control?
Thanks
|
|
|
|
|
Create the ConnectionString dynamically based on the selection.
|
|
|
|
|