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
W

work_to_live

@work_to_live
About
Posts
104
Topics
39
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Referencing Interfaces
    W work_to_live

    No... Project3 creates an instance of Class1.

    C# question

  • Referencing Interfaces
    W work_to_live

    I have three projects... 1) An interface definition dll as Project1. 2) An object definition dll as Project2. 3) A test application as Project3. Class1 in Project2 implements the interface defined in Project1. The test application uses Class1. For some reason, I have to add a reference to the interface dll in both Project2 and Project3! I thought it would only be necessary to reference the interface in Project2, and that it would not be necessary to reference the interface in the application that uses Class1 in Project3. Is this the expected behaviour?

    C# question

  • Collection Editor Question
    W work_to_live

    Thanks, I'll give this a shot!

    ASP.NET tutorial question design data-structures

  • Collection Editor Question
    W work_to_live

    Same question... How do you implement an ArrayList property, with designer support? I also played with that, but no success. I found another way to implement the functionality I was looking for, but I'd still like to know how to create collection properties with designer support. Most of the CollectionEditor descriptions/examples make assumptions about the experience level of the reader, and it looks like I've got a ways to go yet:) FYI I have a navigation header with a different set of images I swap in whenever the it's rendered. I didn't want the overhead of AdRotator, so I rolled my own. The string list (ArrayList) provided the list of images. The alternative solution I came up with was simpler... I created a new folder under images, and put all the images I want in my header in that folder. Now when I want to add a new image to the header, I just add it to that folder, and it appears! Simple... But it would be nice to have the property collection understanding.

    ASP.NET tutorial question design data-structures

  • Collection Editor Question
    W work_to_live

    I'm trying to do something relatively simple (or so I thought). I built a custom control, and I want to be able to add an array of strings to it at design time. From the little research I've done, it looks like I need to create a CollectionEditor based class, and override some of the methods to provide the specifics of my collection. In addition I reference the new class in an attribute for the property. For the life of me, I can't seem to find the right recipe. A couple of questions... Is there a simple way to add an array of strings to a custom control at design time? If not, can you provide an example of how to use the CollectionEditor class to add an array of strings to a custom control? Thanks... Frustrated...

    ASP.NET tutorial question design data-structures

  • Custom Control Problem
    W work_to_live

    I built a Web Custom Control in one solution, and it's working fine. It was built as a separate project with the target set to Class Library. I added the control to the toolbox, and can add it to another project in that solution by dragging it onto any webform. I moved it (the project) to another computer, built it and added it to the toolbox as before. When I try to add it to a webform I get a circle with a line through it, and don't have a clue what to do now! Any suggestions? More Details... I tracked it down to changing the Namespace of the custom control... Why would that have anything to do with being able to drag and drop the control onto a webform?

    ASP.NET help question

  • Datagrid Designer question
    W work_to_live

    Thanks... I've added those two calls to my pages, and everything's working fine. Was just wondering if I was missing something.

    ASP.NET question database

  • Datagrid Designer question
    W work_to_live

    I'm just about at that point... It looks like I need to learn all the quirks of the designer, instead of doing something useful. I went back to my hard coded version, and will come back to the designer approach some day... Maybe!

    ASP.NET question database

  • Datagrid Designer question
    W work_to_live

    I've been playing around with a web application driven by an Access Database. I can programmatically connect to the database fill a dataset, bind the dataset to the datagrid, and everything works as expected. Here's my question... I thought I could do all that from the designer, so I commented out code that programmatically connects to the database loads the dataset, and binds to the Datagrid. Then made the same connections with the designer through the properties of the DataGrid. In the designer, I added a DataAdapter, and generated a Dataset from it. Then I set the DataGrid DataSource to the DataSet, and Set the DataMember to a table within the Dataset. In the PageLoad event handler, I added a call to DataBind(), but when I run the app, the DataGrid doesn't load! Am I trying to do too much with the designer?

    ASP.NET question database

  • Web Custom Control Designer issue
    W work_to_live

    I tried that, but I still have the problem where the designer adds HTML code that duplicates the rows I added in the controls constructor! I hope the code displays ok... :( ... Here's the entry the designer adds initially... ... As soon as I modify an attribute in the custom control, all this gets added to the HTML file!

    Web Development csharp design help question

  • Web Custom Control Designer issue
    W work_to_live

    Just starting to familiarize myself with dotNet web design, and don't understand the behavior I'm getting with a Web Custom Control. To play around with custom controls, I decided to build a web site navigation control built around a table that's populated with the logo, and the common links in the web site. Then I just insert this control at the top of each page in the site, set one of the properties to indicate which link should be deactivated, and I've got a nice easy to maintain navigation control. The funny behavior I get is when I set one of the controls properties in the designer... For some reason, all the rows and columns I added to the custom control in the constructor are duplicated in code on the form the control is in! What's that all about? If that's not enough detail, here's a brief description of how I built the control... I added a web control project to my solution, and modified the template to use WebControls.Table as the base class. Then (here's where I might be going wrong) in the constructor, I added the rows and columns I wanted my control to have, and I also added the navigation links. To use the control, I add it to the toolbox, and drag it onto the form I want to use it on. Then I have to set a property that deactivates the link for the current form, and for some reason, code is added to the form that duplicates the rows and columns I added in the constructor of the control!

    Web Development csharp design help question

  • DataTable > DataView > ComboBox?
    W work_to_live

    Oops... I hope I didn't mislead you... I'm not changing the column names, I'm changing the content of a column in one of the rows of the DataTable. When I do that, the new value doesn't propogate to the combobox. If I add a new row to the DataTable, everything propogates as I expected.

    Database question workspace

  • DataTable > DataView > ComboBox?
    W work_to_live

    I ended up handling the Underlying DataTable RowChanged event, and as you suggested, re-bound the combobox to the DataView. It seemed so cumbersomb that I thought there must have been a better way. Thanks for the reply.

    Database question workspace

  • DataTable > DataView > ComboBox?
    W work_to_live

    I wanted to bind the elements in a ComboBox to a column in a DataTable, but wanted them to be sorted. This application is targeted for the Compact Framework, and I didn't see a way to do that directly. I decided to create a DataView object from the DataTable with the particular sort I was looking for. I set the DataSource of the ComboBox to the DataView, and setup the Display and Value members as needed by the app. Everything seemed to be working as expected, but I have run into one snag I can't seem to solve. If I change the name of one of the colunmns in the DataTable (ultimately the DisplayMember in the ComboBox), it doesn't propogate to the ComboBox by way of the DataView. On the other hand if I add or delete a row to the DataTable, everything does propogate to the ComboBox, even the row where I only changed the name! Is this the expected behaviour? Is there something I can do to force the ComboBox to reload it's drop down list?

    Database question workspace

  • DataTable with nested Child Tables??
    W work_to_live

    Thanks... That would definitely do the trick, and I'll play around with it, but to my question, is there some way to perform this operation with a single Select "like" call? Maybe there isn't a way to do this, and that's fine, I'll continue working with nested foreach constructs, but I keep thinking the disconnected DataSet should be able to perform operations that are possible with SQL. As I'm sure you're aware, the SQL equilalent of what I'm trying to do with the DataSet is as follows... SELECT * FROM TABLE1,TABLE2,TABLE3 WHERE TABLE1.Table2Link=TABLE2.Table1Link AND TABLE2.Table3Link=TABLE3.Table2Link AND TABLE3.ColumnOfInterest=something

    Database database testing beta-testing tutorial question

  • DataTable with nested Child Tables??
    W work_to_live

    Let's assume I have three tables, where Table1 is the topmost table, Table2 is a child relation to Table1 and Table3 is a child relation to Table2. I'd like to get all rows in Table1 where a column in Table3 is a particular value. This is fairly straight forward with an SQL query, but I can't figure out how to do it with DataTables/DataSets. Any suggestions? The only solution I've been able to come up with involves getting every row in Table1, and then GetChildRows twice to get to Table3, and testing the column of interest in Table3... foreach (DataRow row in Table1.Rows) { if (row.GetChildRows("Table1-Table2")[0].GetChildRows("Table2-Table3")[0]["ColumnOfInterest"] == something) { This is one of the desired rows, do something with it } } Seems very cumbersomb. You'd think there'd be a way to execute a single "query" that would return the desired set of rows...

    Database database testing beta-testing tutorial question

  • dll/ActiveX issue
    W work_to_live

    I'm trying to build a library of specialized helper functions I can move from project to project. I'm currently building an ActiveX control, and linking with this "helper" library (dll). This is the first time I've built my own dll, and I'm having some problems. Here's the problem I'm having... I have a class I export in my dll, and can successfully import it into my control, but if I change the arguments in one of the member functions to a CString reference, the ActiveX control crashes when it executes that function. If I change the argument to pass by value, everything is OK, but I can't modify data in my control. I realize this is a brief explanation, but I'm hoping there's something that comes to mind as far as exporting classes that try to modify data in the calling application (ActiveX control in this case) with a reference to an object (CString) in the calling application. Thanks.

    C / C++ / MFC help com

  • C# - Help with preferred method to add a new row
    W work_to_live

    Here's my brute force method... // Load the current phone numbers sqlDataAdapterPhoneNumber.Fill(dataSetPhoneNumber1); // create a new row System.Data.DataRow row = dataSetPhoneNumber1.Tables["PhoneNumber"].NewRow(); // Fill it row["PhoneNumberTypeID"] = comboBoxPhoneTypeID.SelectedValue; row["EntityID"] = comboBoxName.SelectedValue; row["PhoneNumber"] = textBoxPhoneNumber.Text; // Add it to the dataset dataSetPhoneNumber1.Tables["PhoneNumber"].Rows.Add(row); // Update the database (might experiment with GetChanges) sqlDataAdapterPhoneNumber.Update(dataSetPhoneNumber1);

    Database csharp database help tutorial question

  • C# - Help with preferred method to add a new row
    W work_to_live

    Just starting to play around with database access in dotNET. I've run through a number of tutorials, and reviewed a number of articles on this web site. All was well and good until I tried to do something on my own... Uh Oh... I created a simple relational database with the following tables... Table - PhoneNumber PhoneNumber_ID PhoneNumber PhoneNumberTypeID PersonID Table - PhoneNumberType PhoneNumberType_ID PhoneNumberType Table - Person Person_ID FirstName LastName I threw some data in the PhoneNumberType and Person tables, and then wanted to see if I could create a form to add entries to the PhoneNumber table. I added two comboboxes to the form, and bound them to datasets filled with the contents of PhoneNumberType and Person tables. The valuemember of the comboboxes is the ***_ID column of the selected row in the combobox. That's working fine. I added a textbox to the form for the phone number. So, I have all the elements necessary to add a new row to the PhoneNumber table, but I'm not sure of the most efficient method of performing the insert. After poking around on the internet for a while, it looks like there might be two options avaliable to me (there are probably more)... 1) Create a DataAdapter for the PhoneNumber table, then create and fill a dataset with all the phone numbers in the PhoneNumber table. Add the new row and then update the database with the new dataset (need to figure out how to do that). This seems like overkill for this simple function. 2) Create an SQLCommand and execute it with the new row values. I vaguely remember seeing an article that discussed using ?'s in the SQL command, and then filling in the parameters afterwards, but I can't seem to find it again. Is either of these the preferred approach, or is there another approach I might consider. Thanks... whew that was a mouthful.

    Database csharp database help tutorial question

  • Datagrid CurrentCellChanged problem
    W work_to_live

    I have an ArrayList bound to a datagrid. I've developed a method of validating the data entered in the TextBoxes, and forcing the user to re-enter invalid data. Unfortunately, I use the CurrentCellChanged event to test if it's necessary to move the selection back to the cell with the invalid data in it. It works fine with one exception. If you're at the end of a row of data, and press the TAB key (return is fine), you get an extra CurrentCellChanged event. The first one takes you to the beginning of the same row, and the next one takes you to the next row! This messes with my logic that determines if it's necessary to move the selection back to the cell with the error in it. Is there some way to inhibit the handling of the TAB key once you've determined that you want to select another cell?

    C# help 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