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
Z

zuhx

@zuhx
About
Posts
37
Topics
21
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Deleted row information cannot be accessed through the row
    Z zuhx

    I have a datagrid bound to a dataview. I created some functionality to add new rows and delete rows. When I delete an row and click on the save button to save to the database I get the following message: "Deleted row information cannot be accessed through the row". And the delete obviously fails. Anyone with ideas on this?

    C# database question

  • Updating table from datatable
    Z zuhx

    I am trying to update a table from a datatable. The datatable is populated first from a text file and then I would like to get that data into a database datatable. However the code below does not work, part of it is I do not know how to associate the connection string to the data adapter. Also, is there anything else I need to do? Do I need to have separate Update, Insert, and Delete commands or is it possible to just call the Update command? ConnectToDb connection = new ConnectToDb().conn; //this returns a SqlConnection SqlDataAdapter da = new SqlDataAdapter(); da.Update(ds.Tables["TradeOrderFillsPre"]);

    C# database tutorial question announcement

  • Application configuration?
    Z zuhx

    Look at XML serialization. You can create an xml file that contains your app settings. You would simply 1. open a file stream 2. create xml formatter 3. serialize the settings you choose to the xml file. Take a look at serialization. You could use the .config file but this is read only, therefore you cannot create a user interface to modify it.

    C# help tutorial csharp question workspace

  • Adding DataRow to DataTable
    Z zuhx

    I am trying to add an arraylist to a datatable. The ArrayList contains a struct and the the struct basically holds several object variables. I use a foreach statement to loop through the arraylist and add the data to a datarow then add the datarow to a datatable. However, when I try to add the second datarow I get an error message saying 'This row already belongs to this table'. Even though I know the data has changed the it is a completely different row. I am including my code snippet, any suggestions is appreciated: r = DataSet.Tables["TradeOrderFills"].NewRow(); theData = (ArrayList) oFills.GetByIndex(0); Console.WriteLine("theData count "+theData.Count); foreach(TradeData td in theData) { Console.WriteLine("Adding Row to DataTable"); Console.WriteLine(td.ticker); r["preTicker"] = (string)td.ticker; Console.WriteLine("column value "+r["preTicker"]); Console.WriteLine(td.transactionType); r["preTransType"] = (string)td.transactionType; Console.WriteLine("column value "+r["preTransType"]); r["preOrderTime"] = (string)td.orderTime; r["prePrice"] = Convert.ToSingle(td.price); r["preQ"] = Convert.ToSingle(td.fillQ); r["preAccount"] = (string)td.account; r["preBroker"] = (string)td.broker; r["preStatus"] = (string)td.status; DataSet.Tables["TradeOrderFills"].Rows.Add(r); //THIS IS WHERE THE ERROR OCCURS ON THE 2nd ITERATION Console.WriteLine("Number of Rows "+DataSet.Tables["TradeOrderFills"].Rows.Count); }

    C# help

  • implementing IList for a sortedlist
    Z zuhx

    Thanks! Much appreciated. I'm gonna give it a try later this afternoon.

    C# question

  • implementing IList for a sortedlist
    Z zuhx

    So if I'm understanding you correctly. If I write a class and extend SortedList I get all the functionality of a SortedList and implement IList for databinding by doing the following: public abstract class IndexSortedList: SortedList, IList //Does order matter here? { //This is the only IList method not implemented by SortedList public void Insert() { DoSomething(); } //Do I have to include this method as well and just simply //tell it to call the Add method from the SortedList? //This method is already implented in SortedList, but required by IList. public override void Add() { //call SortedList's Add method base.Add(); } } Can you confirm the questions in my comments? Thanks!

    C# question

  • implementing IList for a sortedlist
    Z zuhx

    I looking to have a sortedlist that I can bind to form controls. I can write a class that extends SortedList and implements the IList interface. My first question is the syntax for extending a class and implementing an interface are the same. How does the compiler know to differeniate between the two. My other question is since the SortedList class already implments many of the methods required for the IList interface (e.g. Add, Clear, Contains, etc...) do I have to overwrite these methods?

    C# question

  • best approach for storing login info
    Z zuhx

    I have an application that connects to a database where the user has to log in to access the app. The login screen is the first screen the user encounters and requires the user to enter username/psswd info along with database info (i.e. database name, server name, etc...). I want to set it up so that when the app is run it will pull up the info entered by the user from the last time. What is the best way to approach this? I thought of XML serialization, but as I understand it, this is not a secure method and therefore passwd info should not be stored in passwd file. I already make a database connection in this form, so if I could I would like to store this data in the database, but I cannot make the connection string until the user enters that info. I suppose I could do the mix of the two, but how will that affect performance? Any one have thoughts. Thanks in advance.

    C# question database sysadmin xml json

  • no DataSource property for CheckedListBox
    Z zuhx

    How do you databind to checkedlistbox since it does not have DataSource property. I want to bind an array to list the check boxes in that control. Thanks in advance

    C# data-structures

  • databind checkedlistbox to arraylist
    Z zuhx

    Can someone provide some sample code on how to bind to a checkedlistbox to an arraylist? My situation is I have a checklistbox on a form and a method that returns an arralylist in another class. How can I bind the arraylist in one class to the checkboxlist form in another class?

    C# question tutorial

  • Toolbar Component Setting
    Z zuhx

    Is it possible to set the toolbar component buttons to have text only buttons? If there is, what setting needs to be modified? Thanks

    C# question

  • updating dataset through datagrid
    Z zuhx

    STW wrote: try: dataGrid1.DataSource=dvm2; This is not possible as the DataSource property takes a string. Tried different ways to assign dvm2 to DataSource but did not work. STW wrote: dataGrid1.SetDataBinding(dvm2, null); But this is working. I guess the question is, if I bind to a dataview and then make changes to data through the datagrid will the underlying datatable be modified as well. It seems like it should. Here is the FilterView method. It just simply adds a filter on dataset: public DataView FilterView(string dataTable, string filter) { DataView newView = dvm.CreateDataView(tom.tradarOmsMapping.Tables[dataTable]); newView.RowFilter = "Oms like '"+filter+"'"; return newView; }

    C# csharp database sql-server wpf wcf

  • updating dataset through datagrid
    Z zuhx

    Here is the code for my data binding. The form has a datagrid and two drop down lists. One of the lists allows the user to choose the table to modify and click a button to retrieve the data in that table. Therefore, when the form initially loads, I only bind it to the dataset and not a particular datatable. After the user chooses a datatable from the drop down list, I have an event handler that updates the data binding. Thanks for any help. The code below is the initial data binding where the control is bound to only a dataset: this.dataGrid1.SetDataBinding(todv.dvm, null) I call another object that creates and manipulates a dataviewmanager (todv). todv.Filterview returns a dataview. So in this case, I bind to a dataview. The event handler to update the databinding: private void retrieveBtn_Click(object sender, System.EventArgs e) { string selectedItem = comboBox1.SelectedItem.ToString(); DataView dvm2 = todv.FilterView(comboBox2.Text.ToString(),comboBox1.Text.ToString()); dataGrid1.SetDataBinding(dvm2, null); }

    C# csharp database sql-server wpf wcf

  • updating dataset through datagrid
    Z zuhx

    Thanks for the response, but I realize that binding a control to a dataset will only update the dataset. The problem is after i bind to the control and update the datagrid.....the data in the dataset is not being modified. is there any code i need to implement to get the dataset updaated with the the data the user has modified in the datagrid?

    C# csharp database sql-server wpf wcf

  • updating dataset through datagrid
    Z zuhx

    I have a datagrid, dataset, and sql server data source. I would like to be able to update my dataset through my datagrid. I thought binding the dataset to the datagrid would give me the ability to do this, but I guess I am wrong (I am new to C# and .NET). I have created a dataAdapter to update the datasource, but I would like to update the dataset first. Can any one help me get started here. What I have is a datagrid and would like to allow the user to do update, insert, and delete data then click a button that will sync the datagrid with the dataset. Any insight is appreciated.

    C# csharp database sql-server wpf wcf

  • getting rows in a dataviewmanager
    Z zuhx

    I created a dataviewmanager because i have dataset and want to provide different views on that that dataset. Is it possible to get the rows in a dataviewmanager? That is, I want to see the contents of the dataviewmanager. Does any one have any sample code?

    C# question

  • getting attribute values from AssemblyInfo.cs
    Z zuhx

    I am trying to get assembly info from the AssemblyInfo.cs file, but for some reason I get a null returned for attributes that I specified. Specifically, I provided values for the AssemblyTitle and AssemblyDescription field but both return empty. Any ideas on this ? public ArrayList GetOmsList() { ArrayList drivers = new ArrayList(); DirectoryInfo driversFolder = new DirectoryInfo(dirPath); //direcotry path of drivers if (driversFolder.Exists.Equals(false)) { Console.WriteLine("Drivers Path Does Not Exist"); //break out of the following code } FileInfo[] allFiles = driversFolder.GetFiles("*.dll"); if (allFiles.Length == 0) { Console.WriteLine("No Dlls Found"); } foreach (FileInfo f in allFiles) { string fileName = f.FullName; try { Assembly a = Assembly.LoadFrom(fileName); Type[] types = a.GetTypes(); foreach (Type t in types) { if (t.GetInterface("IDriver", true) != null) { object[] attributes = a.GetCustomAttributes(true); foreach (object attribute in attributes) { if (attribute is AssemblyTitleAttribute) { drivers.Add("title"+((AssemblyTitleAttribute)attribute).Title); } else if (attribute is AssemblyDescriptionAttribute) { drivers.Add(attribute); drivers.Add("descript"+((AssemblyDescriptionAttribute)attribute).Description); } } drivers.Add(t.Name); Console.WriteLine(t.FullName + " Implements Driver Interface"); } } } catch (Exception e) { Console.WriteLine(e.Message.ToString()); } } return drivers; }

    C# question

  • reading attributes in AssemblyInfo.cs
    Z zuhx

    Thanks for the reply. I tried something similiar to what you have posted, but nothing is returned for the title. Even thought I have an entry in the Assembly title attribute AssemblyInfo.cs file. Any idea why this might happen ?

    C# question

  • reading attributes in AssemblyInfo.cs
    Z zuhx

    How can I read the pre-existing attributes that are found in the AssemblyInfo.cs file?

    C# question

  • Console.Writeline does not write to output window
    Z zuhx

    Console.write and Console.writeline does not write to the output window. this was working before but for some reason no longer does. any one know how i can get it to write to the output window agin.

    Visual Studio
  • Login

  • Don't have an account? Register

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