|
ok i think im misunderstanding you or vice-versa
i had:
<asp:radiobuttonlist id="RadioButtonList_audit" runat="server" visible="false">
<listitem text="Default Audit Settings" value="defaultAudit" enabled="true/">
<listitem text="Create Audit History With Reasons For Changes" value="detailedAudit" />
</listitem></asp:radiobuttonlist>
i wanted to disable listitem text"Create Audit History With Reasons For Changes" etc...
i did
RadioButtonList_audit.Items[1].Enabled = false;
it worked.. problem solved
hmm......
|
|
|
|
|
Just an aside, but you should probably access the items through Id rather than by index (ie, give each listitem an id attribute, and use RadioButtonList_audit.Items["someId"].Enabled). That way, if you add or reorder the options later on, your code won't break. Note that I did not test the above, but only present it as a logical solution. The actual syntax of using the id may vary.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Hi! I need some help!!!
I have to store some datas(picture files)in the path and when harddisk is full i need to overwrite datas by replacing the old datas first!
How can i implement this program ??
thx
|
|
|
|
|
peaceziz wrote: i need to overwrite datas by replacing the old datas first
This automatically implies that you need some sort of mechanism that would maintain file creation order. My suggestion is that you ought to have a data table stored on a local database (SqlExpress is MORE than adequate) where you can retrieve the file names/paths in order and delete as necessary.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
"Animadvertistine, ubicumque stes, fumum recta in faciem ferri?"
|
|
|
|
|
i am using ASP.net, C# anD SQL Server2005,in the following query:
string q = "SELECT collapsed_building.b_name,collapsed_building.b_desc FROM collapsed_building WHERE collapsed_building.b_name LIKE '" + crimewithdate.text2 + "' ";
I WANT TO USE % AFTER THE KEYWORD like SO THAT ALL THE BUILDING NAMES WHICH MATCH THE VALUE ENTERED BY THE USER ARE DISPLAYED
WHEN I WRITE (LIKE '" + %crimewithdate.text2 %+ "'), IT GIVES ERROR, WHAT WILL BE THE CORRECT SENTAX
|
|
|
|
|
(LIKE '%" + crimewithdate.text2 + "%')
|
|
|
|
|
J4amieC wrote: (LIKE '%" + crimewithdate.text2 + "%')
Don't encourage SQL Injection Attackable code, please.
|
|
|
|
|
I didnt encourage it, I simply corrected his mistake. Frankly if the OP has this wrong then he's going to be bafffled by terms that he doesnt understand.
Im 100% with you on the Sql Injection thing, but there is learning to walk before one can run.
|
|
|
|
|
J4amieC wrote: there is learning to walk before one can run.
I teach a basic C# training course. I actually threw out the materials I'd been given on the subject of databases and rewrote it. I ensure that at no time is anyone encouraged to inject values and I go directly to parameterised queries. So far with good results.
However, you might be right. If they already have the bad habit it might make it more difficult to break.
|
|
|
|
|
|
Im glad it worked. Now please heed the warnings below about Sql Injection attacks. IT IS IMPORTANT!
|
|
|
|
|
<br />
string qQuery = "SELECT b_name,b_desc" + <br />
" FROM collapsed_building" +<br />
" WHERE b_name = '" + crimewithdate.text2 + "' ";<br />
maybe u should ty = it always work
(just like an if)
p.s : yuo do not need to write "collapsed_building." as a prefix....
Have Fun
Never forget it
|
|
|
|
|
half-life wrote: " WHERE b_name = '" + crimewithdate.text2 + "' ";
Please don't encourage SQL Injection Attackable code.
|
|
|
|
|
Colin Angus Mackay wrote: Please don't encourage SQL Injection Attackable code.
Can u elaborate please?
i decided not to take "Athics and Hacking" course and instead i took
"advanced algorithms" in university
Have Fun
Never forget it
|
|
|
|
|
|
THANKS
vary infomative
Have Fun
Never forget it
|
|
|
|
|
Please don't do this. You leave your code wide open to Sql Injection Attacks. Instead, consider using the techniques described here[^]. You'll end up a better developer for doing it.
|
|
|
|
|
A few things:
1) Please spell-check the post before you submit. A continuous broken language embarrasses the readers.
2) A continuos all-caps also indicates yelling at the users.
3) Technically, your query is vulnerable for SQL Injection attacks. You may need to review your SQL Querying patterns.
I would also advise you to have a read of Forum Posting Guidelines at http://www.codeproject.com/kb/scrapbook/forumguidelines.aspx [^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
You should be using parameters to pass filterable stuff to the query. Also, there is absolutely no validation on the Text value in crimewithdate
Where cmd is your SqlCommand object:
string value = string.Concat('%', crimewithdate.Text, '%');
cmd.CommandText = "SELECT b_name, b_desc "+
"FROM collapsed_building "+
"WHERE b_name LIKE @name";
cmd.Parameters.AddWithValue("@name", value);
Now, how big is your b_name column? Before you do anything with your query you should ensure that crimewithdate.Text does not exceed that size. Are there any other constraints? (e.g. only permitted to have alpha-numeric characters? Check for those also)
|
|
|
|
|
My 2 cents: you should never prepend with % or + in LIKE statement, it turns off indexes. It could hurt performance if you have lots of entries.
-----
You seem eager to impose your preference of preventing others from imposing their preferences on others. -- Red Stateler, Master of Circular Reasoning and other fallacies
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
When user is editing a DataGridView cell I can not find a way to capture event when user presses 'Enter' key. In OnCellEndEdit there is no way to see which button was pressed, OnKeyDown and OnKeyPress simply do not detect 'Enter' key, they act as if it wasn't even pressed. If I try to add event handler to editing control by getting the control in EditingControlShowing and then adding event handler KeyPress or KeyDown on editing control, it also acts as if 'Enter' wasn't pressed. I've tried googling on this, but can't find it anywhere. I'd appreciate any help or hint on this.
Dragan Matic
|
|
|
|
|
Hello Dragan,
You can try the following code under the KeyPress() event.
If Asc(e.KeyChar) = 13 Then<br />
<br />
MsgBox("Enter Pressed")<br />
<br />
End If
I hope this helps.
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
No, that's the catch. Once you start editing text in the DataGridView cell and press Enter (when you want to finish editing), it isn't caught in either KeyPress, KeyDown or any other Key event. Well I suppose it is caught somewhere but I can't find where.
Thanks for the answer, anyway
Dragan
|
|
|
|
|
Hi,
in order to avoid Illegal Cross Thread Calls
i wrote a delegate for a function that needs to update the GUI
(the functions got parameters)
i do'nt know what is the diffrence bettwen the two way to invoke this function:
purpose 1 :
<br />
<br />
object[] param = { ID, O_Code, sO_Code, state };<br />
HandleMessage handleUpdate = new HandleMessage(HandleMessage);<br />
this.Invoke(handleUpdate, param);<br />
<br />
OR
purpose 2 :
<br />
HandleMessage handleUpdate = new HandleMessage(HandleMessage);<br />
handleUpdate.Invoke( ID, O_Code, sO_Code, state);<br />
<br />
Whats is the difference???
What is Better??
THNKS
Have Fun
Never forget it
|
|
|
|
|
There is no difference. If you look at the compiled IL, you'll see that the compiler transforms (2) to (1) i.e., it creates a object[] with the parameters as the array contents.
|
|
|
|