|
Hello,
Thanks for the reply,
However, I used your method, but got an syntax error "Expression Expected"
Sorry for the confussion, but I should have posted this in the VB.Net forum. I thought i did.
I tried you code in C# and no syntax error, but still did not replace the double qoutes. When I put the mouse on name in debug mode after replace, it still have the double quotes.
code in c#,
<br />
string name = "Peter John";<br />
<br />
name.Replace('\"', '\'');<br />
<br />
MessageBox.Show(name);<br />
What am I doing wrong?
Thanks for your help,
Steve
|
|
|
|
|
Compare the code that you have with the code that quiteSmart posted. What have you removed?
Strings are immutable in .NET. That means that a value of a string can never be changed. To get a different string value you create a new string. That gives that the Replace method does not change the string that it's used on, instead it returns the new string.
---
b { font-weight: normal; }
|
|
|
|
|
string test = "\"Peter John\"";
Console.WriteLine(test);
string test1 = test.Replace('\"', '\'');
Console.WriteLine(test1);
Regards,
Bhupi Bhai.
|
|
|
|
|
Hai,
See the code below:
name="\"Peter John\"";
string SqlQuery = "Select * from employees where EmpName=" + name.Replace('\"', '\'') ;
This will give you the SqlQuery string value as "Select * from employees where EmpName='Peter John'"
Hope this will be useful..
Plz try this...
Regds
Abja
|
|
|
|
|
hi!
my need is to have multiple radio button selection.
i used a group box for each radio button.
but if i want to deselect a radio button i am not able to.
So please help me to have multiple selection and deselction of radio buttons
with regards,
Asha
hi!
|
|
|
|
|
hi,
y dnt u use CHECKBOX instead
hope this helps
Nitin...
|
|
|
|
|
hi,
first NITIN_098 is right. You should use checkboxes and going into radio buttons and group boxes.
Anyways if you chose to use the radio buttons you can implement it ot unselect on check using the on-click event. Put a certain confition in it and say if the radio button is checked uncheck and if not checked then check.
good luck
|
|
|
|
|
Grouped radio buttons are used to make a single selection. Use Checkbox instead.
|
|
|
|
|
What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
|
|
|
|
|
i think System.Array.CopyTo() is used to add array elements to another existing
array object from the index which we specify onwards where as System.Array.Clone() is used to create similar array object with same elements
rahul
|
|
|
|
|
The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array.
The CopyTo() method copies the elements into another existing array. Both perform a shallow copy.
A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array.
A deep copy (which neither of these methods performs) would create a new instance of each element's object, resulting in a different, yet identacle object.
Regards,
Bhupi Bhai.
|
|
|
|
|
The first one (System.Array.CopyTo()) performs a deep copy of the array, the second
one(System.Array.Clone()) is shallow copy of the array
Mohan
|
|
|
|
|
Mohan,
Neither of the two perform deep copy. Both CopyTo and Clone perform Shallow copy.
Regards,
Bhupi Bhai.
|
|
|
|
|
Visit
http://www.thescripts.com/forum/thread269691.html[^]
One para from the same.
A copyto makes a copy of the values in/from a one dimensional array (where
the type of the sender and the receiver has to be the same and the receiver
completly exist already).
A clone copies the references, therefore using the references in the clone
will have the same effect on the referenced objects as using the original
array. Although you can have at a certain moment in a clone more references
than in the original or/and visa versa.
A deepcopy you have to make yourself. The system does not know what objects
you have added to by instance your arraylist. (It can be by instance a
thousand times deep arraylist).
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
Hi Everybody,
Could you help me out from the following problems
related to List view (View: Details) ?
1) How to select the subitem?
2) How can I select one subitem and an item (if possible) ?
3) How to make both items & subitems editable?
Thanks in advance,
Sarvan AL
|
|
|
|
|
for selecting item in listview u can try
foreach(ListViewItem lstitm in listView1.Items)
{
if(lstitm.Index==0)
{
lstitm.Selected=true;
}
}
where lstitm.Index is the row number which u want to select
and for editing the subitem u can try
foreach(ListViewItem lstitm in listView1.Items)
{
if(lstitm.Index==0)
{
lstitm.SubItems[0].Text="xyz";
}
}
rahul
|
|
|
|
|
I need a C# sample project book,
for datadriven application and winsock programming
|
|
|
|
|
For Data driven applications you can refer 'Data-Centric .net programing with c#' wrox publication.
|
|
|
|
|
Using C#.net we have created a custom Textbox control derived from System Textbox class. We alse have a customized design surface,toolbox,propertygrid. The control is dragged and dropped on the design surface and its properties are displayed in propertygrid.
1. Custom textbox is not directly linked to propertygrid ( propertygrid.selectedobject=ObjTextbox is not used)
2. When we change Location/Size of the control using mouse we are unable to update the propertygrid
3. The object resizing does not happen physically.
4. When we drag the control to a different location on design surface, control comes back to its initial position.
Any help is appreciated.
Thanks in advance.
|
|
|
|
|
Hi,
Myself imran, I am quite new to dotnet. i am developing web application using asp.net and C#(Visual Studio 2005). i have defined connection string in web-config
Can any one help me to know How to Access database using this connetion string.
thanks
regards
imran khan
|
|
|
|
|
Welcome to The Code Project.
Please don't post the same question all over the place. Pick the forum that best fits your question.
---
b { font-weight: normal; }
|
|
|
|
|
OleDbConnection dbConnection;
dbConnection = new OleDbConnection();
dbConnection.ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0; " +
"Data Source = " + Application.StartupPath + "\\Data.mdb";
|
|
|
|
|
Hi ,
I want to windows application(C#/VB) example for MDI form and Child Form using menu strip (like as Visual Basic6.0).
Thanks in advance,
Rameshkumar
|
|
|
|
|
When i try to open windows/web application(...in c#)....
its throwing the error message states that....visual c# 2005 compiler could not be created....the system cant find the object specified..... i reinstalled the whole frame work still its giving me the same error...
It is working for VB applications.
can anyone of u help me ...asap
|
|
|
|
|
may be ur application is built in VS 2003 which first require conversion to VS 2005.
|
|
|
|