|
hello,
this is not ASP.NET specific question. However, its really simple.
<br />
string hello = "Hello World";<br />
byte [] bytes = System.Text.ASCIIEncoding.ASCII.GetBytes(hello);
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
thats right thanks very very muchhhhhhhhhhhhhh
|
|
|
|
|
i can find a word from notpade file but dont know how to replace an other word insted of that. can any body help me?
|
|
|
|
|
You might like to change/replace the required text while the text is loaded in some variable. After replacing, you can write back to your text file.
- ashish
|
|
|
|
|
hey i am stuck with a problem ,i am asked to make a vertical menu in asp.net and c# where the data will be populated from sql server 2000 database and the menu should have infinite sub menu.
|
|
|
|
|
When does your teacher want the assignment turned in?
"When I get a little money, I buy books and if any is left, I buy food and clothes." --Erasmus
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
|
urgently need code to make a vertical menu with infinite submenu in asp.net and c# where the data will be populated from sql server 2000.Please help
|
|
|
|
|
Hi all,
I want to build online survey using asp.net and oracle database.Take this senario 3 people request the page and find this question:
what is your gender?
(radio button)male.
(radio button)Female.
2 answer male and 1 female,Iwant to know the number of people who answer male or female inorder to use this data latter on.Does i need to define a column in a table of a database and if so how to store these numbers in it.I need the colmn to be as a counter.
please help me.
|
|
|
|
|
n=n+1
"When I get a little money, I buy books and if any is left, I buy food and clothes." --Erasmus
|
|
|
|
|
- create a lookup table with 3 fields (ID, SexItemName, Value)
- create a stored procedure that increments the value column based on ID.
- databind the radiobuttonlist.
- Get the value chosen
- Call a stored procedure with the value chosen.
- Done
|
|
|
|
|
My Sql statement looks like this:
SELECT * FROM TBL_MyTable WHERE ID in (1,5,9,10,5248)
I want to use parameterized SQL command, how can I add the parameter value to it? This is what I have so far:
cmd.CommandText = "SELECT * FROM TBL_MyTable WHERE ID in @ID"
cmd.Parameters.Add("@ID", SqlDbType.Int.Int).Vlaue = "(1,5,9,10,5248)";
but its not working, any suggestions? Thanks.
|
|
|
|
|
The problem is that "(1,5,9,10,5248)" is not of type SqlDbType.Int.
You have a few options:
1. Build the CommandText string dynamically in the program.
2. Build the SQL statement in a Stored Proc, then run it via sp_executesql (NOT SAFE).
|
|
|
|
|
|
Until I've seen your update method, I'm not convinced that it's a bug at all.
---
b { font-weight: normal; }
|
|
|
|
|
hey, the problem is not in my update method... the fields arrive in the update with null values, and not the values provided by my select method
Jesus is Love! Tell to someone!
|
|
|
|
|
If you specify that the DetailsView should only care about two of the properties in the data source, how can you expect it to send along the values of the other properties?
The DetailsView does not change the values to null, it just leaves the values as they were. If you don't populate the values first, they are still null after the DetailsView has populated the properties that you specified that it should handle.
So, it's not the DetailsView that sets the values to null, it's you.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: The DetailsView does not change the values to null, it just leaves the values as they were.
FALSE!!! It is the EXACT PROBLEM!!!
Guffa wrote: If you don't populate the values first
I'm populating correctly...
Guffa wrote: So, it's not the DetailsView that sets the values to null, it's you.
FALSE again... My Select procedure fully populate all fields... but the DetailsView does not maintain the fields what is not used as BoundFields.
Please, follow the link:
Working with Data in ASP.NET 2.0 :: Examining the Events Associated with Inserting, Updating, and Deleting
[^] by Scott Mitchel
In the editing interfaces from the previous tutorial all product fields that were not read-only had to be included. If we were to remove a field from the GridView - say QuantityPerUnit - when updating the data the data Web control would not set the ObjectDataSource's QuantityPerUnit UpdateParameters value. The ObjectDataSource would then pass in a value of Nothing into the UpdateProduct Business Logic Layer (BLL) method, which would change the edited database record's QuantityPerUnit column to a NULL value. Similarly, if a required field, such as ProductName, is removed from the editing interface, the update will fail with a "Column 'ProductName' does not allow nulls" exception. The reason for this behavior was because the ObjectDataSource was configured to call the ProductsBLL class's UpdateProduct method, which expected an input parameter for each of the product fields. Therefore, the ObjectDataSource's UpdateParameters collection contained a parameter for each of the method's input parameters.
If we want to provide a data Web control that allows the end user to only update a subset of fields, then we need to either programmatically set the missing UpdateParameters values in the ObjectDataSource's Updating event handler or create and call a BLL method that expects only a subset of the fields.
Understood? I think wrong these behaviour, because in the SELECT method I get all fields, but in UPDATE, DetailsView place NULL in not used fields (
Jesus is Love! Tell to someone!
|
|
|
|
|
Clickok wrote: Guffa wrote:
The DetailsView does not change the values to null, it just leaves the values as they were.
FALSE!!! It is the EXACT PROBLEM!!!
Stop screaming.
If you had taken the time to test this properly, you would see that I am correct. The DetailsView creates a new object of your class and populates it with the values that it has. The values that the constructor of your class puts in the properties that the DetailsView does not handle are unchanged when it has populated the object.
Clickok wrote: Guffa wrote:
If you don't populate the values first
I'm populating correctly...
No, you are not. As the values are null after the DetailsView has populated the object, the values were null before.
Clickok wrote: Guffa wrote:
So, it's not the DetailsView that sets the values to null, it's you.
FALSE again... My Select procedure fully populate all fields... but the DetailsView does not maintain the fields what is not used as BoundFields.
What the Select procedure does is irrelevant. The Select procedure is not used to create the object.
Clickok wrote: Understood? I think wrong these behaviour, because in the SELECT method I get all fields, but in UPDATE, DetailsView place NULL in not used fields
That is based on a false assumtion. The DetailsView does not change unused fields at all.
---
b { font-weight: normal; }
|
|
|
|
|
Hey, sorry. Screaming was not my intention. I wish only emphatisate my words... I'm very sorry..
Guffa wrote: If you had taken the time to test this properly, you would see that I am correct. The DetailsView creates a new object of your class and populates it with the values that it has. The values that the constructor of your class puts in the properties that the DetailsView does not handle are unchanged when it has populated the object.
Maybe you not understood me correctly... Do you readed the link what I provided? Specially this part:
The ObjectDataSource would then pass in a value of Nothing into the UpdateProduct Business Logic Layer (BLL) method, which would change the edited database record's QuantityPerUnit column to a NULL value
Scott continues explaining:
The reason for this behavior was because the ObjectDataSource was configured to call the ProductsBLL class's UpdateProduct method, which expected an input parameter for each of the product fields
And how it is one default behaviour for DetailsView, Scott give some solutions:
If we want to provide a data Web control that allows the end user to only update a subset of fields, then we need to either programmatically set the missing UpdateParameters values in the ObjectDataSource's Updating event handler or create and call a BLL method that expects only a subset of the fields.
Why one solution is needed if not exists one problem, understood?
I have explained in MS Feedback what I think this a security problem. Here my words:
By example, If I set one DetailsView form to edit User profile data. Of course, I will not include the password fields. The password fields will be edited in specific place (using ASP.Net built-in Login Controls, by example).
But by default, the unused fields of the Bussiness layer object will receive "null", what if one begginer coder, by example, developing these form, is not aware of this problem will surelly post a lot of nulls in password fields, breaking any web application, avoind what legitimate users perform login, bringing a lot of headaches just because of a single by default behaviour...
BTW, thank you very much for your attention to my problem. I hope what we can dig more asp.net bugs in future
Jesus is Love! Tell to someone!
|
|
|
|
|
Clickok wrote: Maybe you not understood me correctly...
I understand just fine what you mean.
Do you readed the link what I provided?
Actually, no, I did not read the article. I didn't need to read it to understand what you mean, and what I read of it now does not support your point anyway.
Why one solution is needed if not exists one problem, understood?
If you try to use a component in a different way than it was intended, then it's of course a problem. It is not, however, a bug in the component.
I have explained in MS Feedback what I think this a security problem.
The alternative would be a real security problem. It would mean that all properties in the class would be sent to the browser and back again, potentially exposing sensetive data to the user without you even realising it, and with no way of stopping it if you did realise it.
---
b { font-weight: normal; }
|
|
|
|
|
|
Hello.
I'm searching for a Calendar Control. It should be a weekly calendar.
There should be two controls. One where i can select a day and another one where i have the weekly calendar from the choosen date of the other one.
It's for a firm...every worker should be able to sign in his daily works.
This datas should be saved in an SQL Database.
How can i realize this and which calendars should i take?
If you know something interesting for me please post it here.
Friendly Greetings
Benno
|
|
|
|
|
|