|
not shore what you meen, but I don't think cookies gona help you with this.
You have to call your update method, something like
<br />
public void updateMySQL_table(int rowID, string valueFromDropDownList)<br />
{<br />
string sql = null;<br />
DataManager dm = null;<br />
<br />
try<br />
{ <br />
sql = "UPDATE someTable SET strTheColumn = 'valueFromDropDownList' WHERE someRowID = " + rowID.ToString+ ";";<br />
<br />
<br />
dm = new DataManager();<br />
dm.ExecuteSQL(sql);<br />
<br />
}<br />
catch(Exception e)<br />
{<br />
throw new Exception("updateMySQL_table failed. " + e.Message);<br />
}<br />
finally<br />
{<br />
if (dm != null)dm.Dispose();<br />
dm = null;<br />
}<br />
}<br />
each row in your Grid should also contain a value where you have set the rowID, something like
<br />
<asp:TemplateColumn><br />
<ItemTemplate><br />
<input type="hidden" runat="server" id="inRowID" value='<%#DataBinder.Eval(Container.DataItem, "rowID").ToString()%>'><br />
</ItemTemplate><br />
</asp:TemplateColumn><br />
This you also have to retrive the rowID
<br />
HtmlInputHidden _inRowID = new HtmlInputHidden();<br />
DropDownList myDropDownList = null<br />
foreach(DataGridItem dgi in MyGrid.Items)<br />
{<br />
_inRowID = (HtmlInputHidden)dgi.FindControl("inRowID");<br />
myDropDownList = (DropDownList)dgi.FindControl("MyDropDownList");<br />
updateMySQL_table(int.Parse(_inRowID.Value), myDropDownList.SelectedValue);<br />
} <br />
Hope it helps
Thomas
-- modified at 7:14 Tuesday 11th April, 2006
|
|
|
|
|
Do you know in visual studio you can use some authomatic possability.I mean exacly if you made some sqldatasorce and then go to property of this sqldatasorce you can go to query.When you are there you can type directly update function and to add some parameters so my problem is going from that becaus i can't give one paramet who i can take only form dropdownlist.Do you know how to do that ???
|
|
|
|
|
Sorry I'm not familiare with that, but you can't update a tablecell with only one parameter, you need to know witch row the the cell is in, thus the rowID (the unike ID that belongs to that table), it is usaly the Primary key for that SQL table.
|
|
|
|
|
I have build my web in asp.ne and c#. I want to put certain user permissions as they login. the website contains several pages and on each page different users have different access level. like admin can do all operations whereas a simple user only can view or add but not delete. I want also the administrator to change the user access level from time to time.
Deepak Anish
Computer Programmer
Maxumise Fiji Ltd
Suva, Fiji
|
|
|
|
|
Hi how to wrap text in treeview.
Deepak Anish
Computer Programmer
Maxumise Fiji Ltd
Suva, Fiji
|
|
|
|
|
You're probably going to have to override the drawing of the TreeNodes and draw them manually. You can draw them wrapped using the StringFormat class. You'll also want to turn off the horizontal scrollbar for the treeview.
|
|
|
|
|
I need to search a plain text string find the ascii carriage returns (or whatever SQL Server returns them as) and replace them with some < br > tags.
I cannot find (using Google) an example for how to do this.
Ideas?
Thanks,
- Rex
The enemy's gate is down.
Welcome to CP in your language. Post the unicode version in My CP Blog[^] now.
|
|
|
|
|
|
|
code-frog wrote: ave seen that no net
Yeah, that's one thing I wish I could turn the clock back and have the CLR team change: the string.DoSomething functions don't actually modify the string as they would have you believe. They should've renamed them to make it more clear what's really happening. Better yet, make them static methods.
|
|
|
|
|
Nothing modifies strings, they are immutable.
|
|
|
|
|
Yeah I know, that's what I'm saying: the current string methods as they are lead one to believe they modify strings, when in reality they create copies of the original. The names should've been named something to reflect this fact (ReplaceInCopy or something), or have the string methods be static methods rather than instance methods.
|
|
|
|
|
Hi
I'm trying to build a quick app in C# to filter out some info from emails, like the user's email address and why the email didn't reach the user.
example :
The text I'm using is the following:
"Hi. This is the qmail-send program at store3.netvisao.pt.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
username@domain.com:
Sorry, no mailbox here by that name. (#5.1.1)"
I would like to build a regex based on this text.
Can anyone give me a hand on this?
Thanks in advance.
Jorge
-- modified at 19:18 Monday 10th April, 2006
|
|
|
|
|
What particular information are you looking to extract?
|
|
|
|
|
In this particular case I'm interested in extracting the email address and the specific reason why the message wasn't sent.
Example:
Hi. This is the qmail-send program at
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
<username@domain.com>:
Sorry, no mailbox here by that name. (#5.1.1
Thanks in advance for the help.
Regards
Jorge
|
|
|
|
|
Hi,
I like to know is there any event that is fired before treelistview is displayed that sets the checked items. I know itemcheck event but like to know somethign like "Paint". I am using .NET 1.1 and C#.
Thanks in advance.
|
|
|
|
|
|
Thanks for the reply.
I tried the Invalidated event and its only fired for the first time. After the TreeListView is displayed once and then user clicks/checks one of its node, ItemCheck event is fired. I want to know the next event fired after ItemCheck that actually set the TreeListView with all the checked and expanded Items before dispayng.
Thanks.
|
|
|
|
|
Hello. I am using HttpWebRequest to post some photos to a website. For some reason, I can post two photos to the website, then every other one times out. So, I restart the program, it does the next two, then times out on the rest. I am using .net 2.0, and here is my sample code:
<br />
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(string.Format("{0}/{1}", this.sUploadURL, this.sAuthHash));<br />
req.Method = "PUT";<br />
req.AllowWriteStreamBuffering = true;<br />
req.KeepAlive = false;<br />
<br />
Stream reqStream = reqStream = req.GetRequestStream();<br />
FileStream reader = new FileStream(fullFileName, FileMode.Open);<br />
It times out when I call req.GetRequestStream() . Any ideas?
Mike - I love to program!
|
|
|
|
|
Hello all i am noob to C#(though i have a lot of former experience with c/c++)
anyway i am new to graphical oriented aplications)
I created a form .
the doublebuffering field is set to true.
Now i am animating a square on the screen using the timer controler
and the system.drawing.graphics functions.
I still see flickering effects though i turned on the doublebuffering, i know that the doublebuffering option should eliminate the flickering things but it doesnt.
anyone got any idea why it happen?
I am using VS2005
|
|
|
|
|
We'd really have to see some code. Also, if you're doing the painting for the control itself, make a call to the following inside you're constructor:
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);
|
|
|
|
|
|
Hello,
I have a BackgroundWorker object which I use to call a webservice. I want the call to be able to be cancelled, but unfortunately calling CancelWorkerAsync only sets a property and the DoWork event handler must return. However, since I am blocked in the webservice call, I can't check for the property or cancel. Is there a way to kill the worker process from the UI thread?
Thanks in advance,
Luis Alonso Ramos
Intelectix
Chihuahua, Mexico Not much here: My CP Blog!
|
|
|
|
|
Hi
Why don't you use the async methods to call the web service in your thread. Then you can then put your thread in a loop ( with a Sleep call ) which polls for your two exit conditions - cancellation or result.
In fact, why do you need a BackgroundWorker ? Why not just call the async methods from your main thread?
----------------------------
Be excellent to each other
EasiReports[^] My free reporting component for WinForms.
|
|
|
|
|
Nicholas Butler wrote: Why not just call the async methods from your main thread?
Because actually I'm using remoting through the internet, not a web service. It's a call that searches for customers, so it might take more than a few seconds.
Luis Alonso Ramos
Intelectix
Chihuahua, Mexico Not much here: My CP Blog!
|
|
|
|