Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

Noctris

@Noctris
About
Posts
45
Topics
8
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Web file download from C# console application gets 401
    N Noctris

    Well, we have some software of ours downloading files from apache and i think you are making it way to difficult:

    System.Net.NetworkCredential cred = new System.Net.NetworkCredential();
    cred.UserName = "Your Username";
    cred.Password = "Your Password";
    System.Net.WebRequest req = new System.Net.WebRequest();
    req.Credentials = cred;

    Do Or Don't, there is no "try catch ex as exception end try"

    C# help csharp java swift apache

  • ComboBox AutoComplete with id value
    N Noctris

    For the people that want to know. Apparently the Leave event is fired before autocomplete can do it's magic however, Putting the handler on the LostFocus event solves the issue. It's just not visibile in the VS2005 UI... Solved ;-)

    Do Or Don't, there is no "try catch ex as exception end try"

    C# database help question

  • Regex question
    N Noctris

    Expresso - A Tool for Building and Testing Regular Expressions[^] should do the trick..

    Do Or Don't, there is no "try catch ex as exception end try"

    C# csharp regex database question

  • ComboBox AutoComplete with id value
    N Noctris

    Hmm.. unfortunately, it does not even recognize that :( Strange thing is, if i look at what cmbAuthors.text contains, it is the text i want.. but it does not work. so that got me thinking and i tryed:

    cmbAuthors.selectedtext = cmbauthors.text;

    But.. helas.. it only uses the actual typed text so for example "mad" if you are looking for madonna :s I am thinking that autocomplete uses the same event (leave) to do it's autocomplete magic.. When i change the handler to the "onSelectedValueChanged", it does work .. however, that event get's fired multiple times on Runtime (so when binding the datasource for example)... and does not fire when the value you type in is unknown in the dataset/autocomplete The problem is that i really have to do the check when leaving the combo ...

    Do Or Don't, there is no "try catch ex as exception end try"

    C# database help question

  • Help! implementing user session timeout in winform c#2.0
    N Noctris

    Hi there, Although your idea is not bad, i find it a rather strange way of doing an expired session... what i would do ( although i am no coding god either so feel free to correct me) For example you want your session to be valid for 15 Minutes: You simply make a Session variable like: session.Item("expirationtime") = DateTime.Now().AddMinutes(15) then, on every call you make that is < session.Item("expirationtime") , you set this again

    if(session.item("expirationtime") < DateTime.Now())
    {
    // redirect the user back to the login page

    }

    Seems a hell of a lot simpler and has better performance then spinning of threads to keep timers ticking.. (500 visitors logged in means 500 threads running a timer)

    Do Or Don't, there is no "try catch ex as exception end try"

    C# csharp help career

  • ComboBox AutoComplete with id value
    N Noctris

    Hi Everyone, I have a combobox that i need to populate with a datasource from my database. Because i want to make this autocomplete AND have the possibility to enter new things, i have done the following:

    Private void LoadAuthors()
    {

    cmbAuthors.DataSource = Dataset;
    cmbAuthors.DisplayMember = "Name";
    cmbAuthors.ValueMember = "Id";
    cmdAuthors.AutoCompleteCustomSource = AutoCompleteStringCollectionIMadeFromTheDataSet;
    cmbAuthors.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
    cmbAuthors.AutoCompleteSource = AutoCompleteSource.CustomSource;

    }

    And all is well in Autocomplete land and datasource land.. however... to find out if they entered a new name ( and i need to pop up a form to complete extra info), i have a handler for the "leave" event on the combobox:

    private void cmbAuthors_Leave(object sender, EventArgs e)
    {
    if (cmbAuthors.SelectedValue != null)
    {
    MessageBox.Show("We know the dude...");
    }
    else
    {
    MessageBox.Show("Who's that ? better make a new one !");
    // FrmAuthorDetails FrmAddNewAuthor = new FrmAuthorDetails();
    }
    }

    now the problem is: When you leave the combobox, the selectedvalue always is null, i get the "who's that" message, and when i click ok to that THEN the selectedindex event fires on the combobox (and thus only getting the required data to make this check) Is there any way to make sure the selectedindex event is fired first or manually fire the autocomplete so it will complete BEFORE, it actually fires the leave event ? Any other intelligent solution i could not think of or have not found on google codeproject is welcome too obviously ;-)

    Do Or Don't, there is no "try catch ex as exception end try"

    C# database help question

  • Deleting Coresponding Row(s)
    N Noctris

    Hmm.. Small Reaction. As i understand, you are actually handeling your "MovieID" in code. You should let your database handle this and just request what id it gave to the last record you inserted in the database ( syntax might depend on the database you are uding) About deleting the cast records related to the movie: you actually do the right thing ;-) I don't see any other way then to simple delete all records in that table related to the movie you have deleted.

    Do Or Don't, there is no "try catch ex as exception end try"

    Visual Basic database csharp help question

  • how to update the datas present in textbox to gridview control (gui) ,SQL2005
    N Noctris

    Your gridview does not know of the update as long as you don't tell it you have done an update. You should requery your database for the new data

    Do Or Don't, there is no "try catch ex as exception end try"

    C# css database wpf wcf tutorial

  • Global ( sort of) event ?
    N Noctris

    Hi, Thanks for the reply. If i understand correctly, making a class a static singleton( have never done that before :s) would make it availble for calling in the Child class, but the instance of the singleton class that the child gets, would be the same instance as the one the host app would have right ? I'm a VB.net converty ANd relativly new to development so i am still discovering some of the (c#) syntax and possibilities...

    Do Or Don't, there is no "try catch ex as exception end try"

    C# question css sysadmin data-structures tutorial

  • Object Required: WScript
    N Noctris

    The same as you did for wshscript.. but i'm guessing this is copy past. Brushing up on OOP could help a lot more ..

    Do Or Don't, there is no "try catch ex as exception end try"

    Visual Basic linux tools help tutorial

  • How to Create MySQL database and Restore in VB 6.0
    N Noctris

    Yes.. it is.. (As long as you code it)

    Do Or Don't, there is no "try catch ex as exception end try"

    Visual Basic database mysql tutorial question

  • how to find latest table created from database.
    N Noctris

    That depends on the database.. but most have a master db where you can query that type of information (Mysql, MS SQL) You should look at the vendors site how to query the master db/table and you should be there

    Do Or Don't, there is no "try catch ex as exception end try"

    C# database tutorial

  • [Message Deleted]
    N Noctris

    I would actually use a checkbox for this. Change the appearence property from "normal" to "Button" then just say that "checked" = "A" unchecked = "a"

    Do Or Don't, there is no "try catch ex as exception end try"

    C#

  • how to include Sql Server 2000 database in a setup project?
    N Noctris

    What database are you using ?

    Do Or Don't, there is no "try catch ex as exception end try"

    C# database tutorial csharp sql-server visual-studio

  • Global ( sort of) event ?
    N Noctris

    Hi, I have a class library, which actuall is a little application itself. It does communication with our server, starts a download queue and autodownloader and does some background processing. This to provide data and files for the different host app's that are using this class library ( see it as a communications client) now in the library, i have some events that need to be received by the host app like for example: FileCountChanged. the problems is, this can be triggered from The AutoDownloader because it finished a download, from the TCP Client cause the server told him to delete a file etc etc.. Now my question is: is there a way to raise a global event from different classes ? The more or less same question applies to variables ( objects). Can i change the variable of my main class from its sub classes ? Something like for example: public delegate void FileCountChangedEventHandler(FileType filetype,int count); public class MyClient { // Should be raised if: // File get's deleted, File is added, // This can be initiated from many different classes... // How do public event FilecountChanged(FileType filetype,int count); private DownloadQueue _dlqueue = new _dlqueue(); // I should be able to add and remove downloads in this queue from anywhere HOWEVER.. it must be this queue. Do i have to pass this to // all the classes that need to use it ? And do i use ref or just normal ? private AutoDownloader dl = null; public Myclient() { dl = new AutoDownloader(_dlqueue); dl.start(); dl.DownloadCompleted += new eventhandler(ondownloadcompleted); } } Thanks !

    Do Or Don't, there is no "try catch ex as exception end try"

    C# question css sysadmin data-structures tutorial

  • Blue Screen on booting from WinX
    N Noctris

    After you install the correct chipset for this (you can also do this during boot by pressing F6 and inserting the driver disk), i would switch this back since the performance of this mode is a lot slower then native SATA mode...

    Do Or Don't, there is no "try catch ex as exception end try"

    System Admin help question

  • To Remote or not to remote, and if so: how ? that is the question.
    N Noctris

    Hi Everyone, I have a question about remoting. We have a server app running on a TCP port where clients can connect to do do all sorts of stuff. These clients are connected over the internet. At the backend, we have our database which the clients query and some other applications ( including management app for the clients, a website etc) connects to this database. Recently, we started moving everything into remoting hosted on IIS for easier use and scalibility ( since most of these apps are doing the same stuff in the same database) Now my question is regarded to the Server application. In there, we have a list of clients ( list(of MyClientClass) to represent the collection of connected clients. I would like to be able to query this "live" list of connected clients and do stuff with them from my different applications. Moreover, i would like to be able to put multiple of these Servers but still be able to treat the connected clients as one collection (if possible). I was thinking remoting both the "client class" as the list of connected clients. Although this has a few minor performance drawbacks ( servers and IIS hosted remoting are in the same place connected over 1 Gbit Ethernet so that should not be such a worry right ?), it makes it easy to interact with the connected client collection. Is this the way to go or should i consider other options ? Thanks !

    Do Or Don't, there is no "try catch ex as exception end try"

    Visual Basic database question sysadmin windows-admin performance

  • DownloadQueue [modified]
    N Noctris

    Hi guys, I am not sure if this should be VB specific or more design but i'm a bit stuck with a dll i try to write. This dll should take care of communication with our server (tcp) and download files. Then this dll can be used by various host applications that need connection with our infrastructure. Now i want to build a download queue which in the back is downloaded ( backgroundworker ) and where i can add downloads selected by the app (it's about music and video files). This "queue" needs to be exposed to the host application so they can see the queue and what is happening.. However.. first i thought of doing this using our database ( we use sqlite for the communications DLL).. however.. sqlite and multithreading don't get along AT ALL.. so this locked the database giving all sorts of evil errors (and worse.. sometimes blocked the TCP Socket from writing data into the local database which takes priority over the downloads Then i wanted to do this using a datatable but this too gives all sort of strange issues which just seem to send me in a loop (exposing the queue using a dataview.. the connected datagridview doesn't refresh as it should, when row is selected that is downloaded and then gets removed from the view we get "isnull" errors etc, etc, etc) Now my ideas are out and i turn here: What is the best way to build a download queue which: Needs to be able to prioritized needs to be visualised like our background thread is using it (so with the priority in place) Where multiple threads can add / remove downloads from it.. Can anyone point me in a right direction ? Many thanks !

    Do Or Don't, there is no "try catch ex as exception end try"

    modified on Sunday, December 28, 2008 9:42 AM

    Visual Basic sysadmin question database sqlite design

  • hi how this string is splited and how to eliminate special characters
    N Noctris

    I know my thought process sometimes is funny to say the least, but i think this one is actually correct ;-)

    Do Or Don't, there is no "try catch ex as exception end try"

    Visual Basic tutorial question

  • hi how this string is splited and how to eliminate special characters
    N Noctris

    I would be saying first replace all characters different then 0123456789abcdefghijklmnopqrstuvwxyz with "" EXCEPT spaces. Then split on the on you space and voila !

    Do Or Don't, there is no "try catch ex as exception end try"

    Visual Basic tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups