You could try the following code: DataView dvUniv = new DataView(dt1); for (int i = 0; i < dvUniv.Count; i++) { dt1.Rows.Add(dvUniv[i].Row); }
Or read this page: http://support.microsoft.com/kb/308909/en[^]
andreumv
Posts
-
Assigning DataView to DataTable -
Assigning DataView to DataTableDataTable dt1 = dvUniv.ToTable();
-
Some issues about ConfigurationManagerI have a custom section defined in the app.config of my application and I want to read the parameters and store the values in a custom class, but I find that the code for ConfigurationManager.GetSection() returns a null value, and I can't find the reason. the full code is the following:
public class WSProvidersFactory : IConfigurationSectionHandler { public object Create(object parent, object configContext, System.Xml.XmlNode section) { WSProvider objProvider = new WSProvider(); objProvider.Name = section.SelectSingleNode("Name").InnerText; objProvider.Type = section.SelectSingleNode("Type").InnerText; objProvider.Url = section.SelectSingleNode("Url").InnerText; return objProvider; } public static string GetProviderUrl(ServiceType _typeService) { WSProvider _provider = null; switch (_typeService) { case ServiceType .Local: throw new Exception("Not Implemented."); case ServiceType.MainWS: _provider = (WSProvider)System.Configuration.ConfigurationManager.GetSection ("WebServiceClientProviders/WsNetTiersProviderPrincipal"); break; case ServiceType.AltWS: _provider = (WSProvider)System.Configuration.ConfigurationManager.GetSection ("WebServiceClientProviders/WsNetTiersProviderSecundario"); break; } return _provider.Url; } [Serializable] private class WSProvider { private string _name; public string Name { get { return _name; } set { _name = value; } } private string _type; public string Type { get { return _type; } set { _type = value; } } private string _url; public string Url { get { return _url; } set { _url = value; } } } }
AND the code in the app.config file is this:< < < <
-
How to compare two Times [modified]Ramana. G.V wrote:
how to compare two times using DateTime object. I need to compare hours & minutes only based on this i am showing some message.
If DateTimeObject1.TimeOfDay = DatTimeObject2.TimeOfDay Then 'do something End If
-
2 DataBases? Yes, 2 DataBasesYay, it worked nice! thanks a lot, mate.
-
User control that cannot be resizedTry writing a (private?) bool property named Resizable. Then you can ask at some point (OnResizing event or something alike) if it can be resized, if not return the size to its initial value.
-
2 DataBases? Yes, 2 DataBasesI wish to know if there is any way to create a trigger that runs when a user makes some insert / update / delete action on a table of a database and then add the same values to a table that dwells in another separate database, both Sql-Server. How can I use the table in the external database? is it possible? Thanks.