
sharpcoder
Members-
Posts
23 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by sharpcoder
-
Hi all, I wonder if you know of any free, nice, editor that is not a trial version? Thanks.
-
I haven't programmed in for a long long time now so this is probably quite easy... Let me know if you want to see more code and what code. Error: Compiler Error Message: CS0103: The name 'threadid' does not exist in the class or namespace 'DefaultCodeBehind' Code: Response.Redirect("showtopic.aspx?threadid="+threadid);
-
Hi, Yes, that's true. ASP.NET automatically checks if your URL string contains any dangerous values, such as: "<br> <h1> a <h1/>" (HTML code). Turn off this aut. detection and check the input by yourself.
-
Check out HttpSessionState.Abandon Method.
-
Hello, maybe you'll want to consult this tutorial: http://www.sitepoint.com/article/921 But it does have some draw backs...
-
Maybe he's trying to make, for example, a virtual desktops program and wants to create some 'hotkeys' to swtich from one desktop to another... I'm sorry for the link, I do c# myself and didn't watch it closely enough.
-
This is the first result out of my google search. Maybe it'll help. http://www.freevbcode.com/ShowCode.asp?ID=4042 ("capture keystrokes" "vb.net")
-
1. MySQL 2. Web application 3. Well... definately no 2 or 3 seconds. 15 lines of code - no loops, no advanced calculations... It seems like I should keep it open. Thanks for the advice.
-
I haven't seen your c#/vb.net code but I think you get a result something like this: 1 1 7 7 9 9 3 3 where it should be: 1 7 9 3 ? Well, that's because you're outputting the same value(s) two times in each iteration of the loop (you're actually not writing a loop, the repeater class saves that for you). You have for example <%#DataBinder.Eval(Container.DataItem, "BrandName")%> two times in each ItemTemplate. In you case I think you should look at: <SeparatorTemplate> and </SeparatorTemplate>
-
I hope I'm not interrupting anything here. (Did you get an answer to your question Heike?) Bungpeng said that there is no need to close database connection but is that always the case? I've got a file using the following pseudo code: - open connection - execute sql-string and fetch some information - close connection - manipulate information - open connection - execute nonquery sql-string - execute another nonquery sql-string - close connection But maybe this is the wrong way to go. I figured that it would be best to, at least, close and later reopen the connection when comprehensivly manipulating data (not to load the DBMS too much) from the database (this is done in about 15 lines of code). But maybe not? Is it better to always follow this approach? - open connection execute different sql-strings, manipulate data, etc - close connection Thank you.
-
Maybe not higher but of course easier. Hackers scan for open ports and if there's many of them... well, then they don't have to search that much. But. If you're using a firewall, such as ZoneAlarm, none of this should be a problem to you.
-
This should be fairly easy to solve, but I can't seem to find the right way. Anybody? Edit: I found "forum.SelectedValue.ToString()" now which worked perfectly. I've tried it before but because of another error in my code I didn't get the result I expected. I'm sorry for wasting your time.
-
Then... What is your suggestion?
-
When it comes to user handling the ideal solution in .NET is Forms Authentication. Normally it creates an encrypted cookie containing the user name of the current user (again ideal for your needs). And if you want to store other values as well (user id, first name, last name, address, what ever...) you can extend the class and add your own get/set properties. THis wasn't and answer to your question (sorry for that) but with Forms Auth. everything comes free and you will not have to bother about the thing you described above. Otherwise... how do you log out? By a button or by closing the browser window? If the latter is true, I think you must destroy the old cookie, NOT when the user signs out, but when he signs IN.
-
Hello, wondery There are several ways to achieve this. If you want a simple alternative, complete out-of-the-box but maybe too complex for your needs, then you could use a datagrid which has built-in support for the thing you're describing. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolsdatagridclasstopic.asp You could also use a Repeater (that would be my choice) or an ordinary loop. With a repeater it would look something like this (in this example there are only two columns bt you'll see how to fix that). .aspx Here, usermessage and username are fields in my database. I get them from a datareader (next code block). <asp:Repeater id="repeater1" runat="server"> <HeaderTemplate> <table width="500"> </HeaderTemplate> <ItemTemplate> <tr> <td><%#DataBinder.Eval(Container.DataItem, "username")%> </td> <td><%#DataBinder.Eval(Container.DataItem, "usermessage")%> </td> </tr> </ItemTemplate> <SeparatorTemplate> <tr> <td colspan="2"> <hr /> </td> </tr> </SeparatorTemplate> <FooterTemplate> </table> </FooterTemplate> code behind: //create a datareader, reading information from your database and bind it to the repeater. repeater1.DataSource = myReader; repeater1.DataBind(); And you're all set!
-
Yes, this IS the right way to do it in .net. You'll also want to check out caching features which will improve performance.
-
Thank you samsmithnz for googling. I think I'll stick to MySQL for now and see what future brings...
-
Then I don't think the SQL code will be a major problem in my case. Otherwise... is the general suggestion that I should change DBMS from MySQL to MSDE?
-
That's the interesting part. How much quicker? Is it stable (more than mysql?)? Can I use the same SQL for MSDE as I have used for MySQL? Thank you.
-
Good evening (and in case you're somewhere else in the world good night and good morning...)! At present I'm using MySQL as DBMS in my web app but I'm having second thoughts... A guy I talked to said that MSDE would boost performance in my case and that even though it's just a budget version of MS SQL it can do a lot more that MySQL and better too. So... Is he lying?
-
NewLetter = Chr(Asc(LetterLine2) - 1) maybe? hmm
-
Thank you for answering Bucky! Unfortunately (?) I'm not calling it from Page_Load but from this method (triggered by a button): public void showadminoptions(object source, CommandEventArgs e) { //some other things... addtodropdown(); }
-
Hi, this is my first post at this forum. :) Ok, so I have this method. The idea is that it should populate a dropdownlist("forum") , on my aspx page, with items. private void addtodropdown() { IDbCommand commForum = ConnectionFactory.makeCommand(conn, "select Xnamn, id from forumcats order by Xprioritet asc"); conn.CreateCommand(); conn.Open(); IDataReader myReader = ConnectionFactory.makeDataReader(commForum); while (myReader.Read()) { ListItem newListItem = new ListItem(); newListItem.Value = myReader.GetString(1); newListItem.Text = myReader.GetString(0); forum.Items.Add(newListItem); } conn.Close(); } I've also got this method: public void movethread(object source, EventArgs e) { if (IsAdmin()) { Response.Write(forum.SelectedIndex.ToString()); IDbCommand comm = ConnectionFactory.makeCommand(conn, "update forumthreads set Xcatid ="+ forum.SelectedItem.Value.ToString() +" where id = " + Request.QueryString["threadid"] + " "); conn.CreateCommand(); conn.Open(); comm.ExecuteNonQuery(); conn.Close(); } } The problem is that I don't manage to fetch the correct values from the dropdownlist in movethread(object source, EventArgs e). its? For example, from the followring HTML code: <option selected="selected" value="5">abc</option> ... I want to extract the value "5". I've tried SelectedIndex. Value, Value, SelectedValue and God knows what else...