Given a DataSet instance, is there any way I can find out which controls are bound to it's tables?
I want to stop everything binding to the DataSet, something like :
foreach (Control cont in dataset.ControlsBoundToMe)
{
if (cont is DataGrid)
{
(cont as DataGrid).DataSource = null;
}
}
Thanks
...
Which one of these techniques is faster?
1)
DbDataAdapter dataAdapter = _factory.CreateDataAdapter();
dataAdapter.SelectCommand = _command;
dataSet = new DataSet();
dataAdapter.Fill(dataSet);
2)
DataTable dt = new DataTable();
IDataReader iDataReader= _command.ExecuteReader();
dt.Load(iDataReader);
iDataReader.Close();
...
While executing this method:
public static List<T> ToList<T>(DataTable dataTable)
{
Type type = typeof(T);
List<T> list = new List<T>();
foreach (DataRow dr in dataTable.Rows)
{
object[] args = new object[1];
args[0] = dr;
list.Ad...
I'm in a situation where I'm being given a dataset to output to an MVC view. I'm really struggling to figure out how to get the modelbinder to pick it up on the way back in after a submit. I have something like this...
public ActionResult TestData()
{
DataSet data = new DataSet("DS");
DataTable table = new DataTable("DT");
...
I have a sequence with an allowed minimum length of zero in my xsd. When I try and load an xml file which doesn't have any elements of the sequence into the DataSet that xsd.exe created I get an exception indicating that my file violated one of the DataSet's constraints. The xml file validates against the schema so I know it's valid. ...
I'm reading data from xml files into a strong typed DataSet. The data ends up in multiple tables; can I run queries against it to create a denormalized view to display in a DataGrid?
Sample input:
<PeopleFile>
<address>
<street>123 some street</street>
<town>anytown</town>
<resident>
<first>Jane</first>
<last>Doe</last>
...
I'm working with DataSets, specifically with a an array of DataRows:
My question is, how am I able to perform Unions/Intersects of DataRow[]'s WITHOUT using LINQ?
...
I've got a DataSet created by the xsd.exe tool to import some xml files, and need to denormalize the data within for display purposes. Instead of writing linq to dataset queries by hand is there any way I can access the tables within a query builder wizard?
...
I'm loading data from multiple xml files with different schemas into DataSets. I do have foreign key style relationships between the tables in each xml file but to date they're only enforced by code. I need to access data coming from multiple files and display it in a DataGridView.
Is there a way to merge the data from multiple file...
I currently have an IQueryable of Questions. In my Question object I have and "id" and a "parentId" which can be used to create a hierarchy. Currently, I bind a RadTreeView to the IQueryable of Questions and the RadTreeView takes care of creating the hierarchy because I define the dataId and dataParentId for the TreeView in the markup....
Existing app passes XML to a sproc in SQLServer 2000, input parameter data type is TEXT;
The XML is derived from Dataset.GetXML(). But I notice it doesn't specify an encoding.
So when the user sneaks in an inappropriate character into the dataset, specifically ASCII 146 (which appears to be an apostrophe) instead of ASCII 39 (single q...
Child elements of my data are being written directly off the root element instead of off the element that is their parent in the schema.
My xsd:
<xs:schema xmlns="MyNameSpace" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="MyNameSpace" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<xs:i...
I'd like to use tabs, or at least more than 2 spaces per indent level. IIRC there are options available to adjust this when using serialization to write a class out; but I don't see any way to adjust the behavior when calling MyDataSet.WriteXml(filename).
...
Dear guys
I want to import a typed DataSet with DataTables (not with TableAdapters) to my SQL Server database. The structure of all DataTables in the DataSet is the same like in the SQL Server database. With the same fields.
How can I import the whole typed DataSet to my SQL Server database?
Best regards
...
BACKGROUND:
Most of my programs use table adapters, and the connection strings are stored in app settings. This works fine, but was a real PITA when switching from development to production environment. I had to change manually the connection strings before and after starting my work on any app.
After a bit of research I found how to sw...
We have a mish-mash app with a legacy module that still uses DataSets, DataViews and DataTables however we have most of the the databases ORMed except the DB for this Module. I was wondering if someone could give me pointers as to how to go about building extensions like
/* generates a dataset called CustomerDS with
DataTable called Cu...
I have a gridview which has many columns.. the columns are got separately and displayed in a gridview.
now i need to sort this gridview but i cannot do that.... i have found a way but i will need to get the gridview in a datatable or a dataset.... is there a a way to do this?
DataSet ds= new DataSet();
ds = Gridview1.????
please help...
My schema looks like this:
<xs:schema xmlns="DAN" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="DAN" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<xs:complexType name="Stuff">
<xs:sequence>
<xs:element ref="Numbers" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:element ...
I'm working on a software that takes a csv file and put the data in a sqlserver. i'm testing it with bad data now and when i make a data string to long (in a line) to be imported in the database i got the error : String or binary data would be truncated the statement has been terminate. that's normal and that's what i should expect. Now ...
I am passing user defined classes over sockets. The SendObject code is below. It works on my local machine, but when I publish to the WebServer which is then communicating with the App Server on my own machine it fails.
public bool SendObject(Object obj, ref string sErrMsg)
{
try
{
MemoryStream ms ...