datacolumn Questions
6
Solved
I've cobbled together a C# program that takes a .csv file and writes it to a DataTable. Using this program, I can loop through each row of the DataTable and print out the information contained in t...
Tiling asked 1/4, 2010 at 3:14
13
Solved
I have:
DataTable Table = new DataTable;
SqlConnection = new System.Data.SqlClient.SqlConnection("Data Source=" + ServerName + ";Initial Catalog=" + DatabaseName + ";Integrated Security=SSPI; Conn...
Marella asked 27/1, 2012 at 1:49
2
Solved
I have a table with 1 column: 'Status'
I want to add in another column named 'Action', its value will be as follow: if Status = 'Yes' Then Action = 'Go', otherwise, Action = 'Stop'. I used this fo...
Mehala asked 11/10, 2013 at 18:38
4
Solved
I am trying to set a default value for a DataColumn. How do you set a default value for DataColumn (column3) for the below code
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[]...
Chimney asked 15/1, 2015 at 3:48
6
Solved
I have a DataColumn of DateTime, I would like to know how I can have only the sooner date (min) and the later date (max).
Thanks
Ternopol asked 28/11, 2011 at 16:40
7
Solved
I have a DataTable obtained from a SQL DataBase, like this:
using (SqlCommand cmd = new SqlCommand(query, _sqlserverDB))
{
using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))
{
DataSet dat...
Commendam asked 19/9, 2011 at 11:32
4
Solved
In C# & .NET, can one create a DataView that includes only a proper subset of the DataColumns of a given DataTable?
In terms of relational algebra, one assigns a RowFilter in order to perform ...
Creigh asked 29/7, 2009 at 15:53
1
Solved
I have a table payments that has a null-able integer column named payMonth. I have the following class and list:
public class months
{
public int payMonth { get; set; }
public string monthName {...
Wondering asked 21/4, 2017 at 13:7
6
Solved
I am trying to create a DataTable and bind it to a DataGridView. It works, but I can't set columns headers via the Caption property. It displays headers using the ColumnName ("City") instead. MSDN ...
Incivility asked 10/1, 2013 at 21:16
1
Solved
I have a datatable with one column:
this.callsTable.Columns.Add("Call", typeof(String));
I then want to add a row to that datatable, but want to give a specific index, the commented number is th...
Asoka asked 17/12, 2013 at 14:11
3
Solved
Is there a better way than this to check if a DataColumn in a DataTable is numeric (coming from a SQL Server database)?
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetStor...
Aflcio asked 12/11, 2009 at 22:37
4
Solved
I need to iterate the columnname and column datatype from a specific row. All of the examples I have seen have iterated an entire datatable. I want to pass a single row to a function to do a bunch ...
Dance asked 10/10, 2012 at 15:47
2
Solved
I have a DataTable with column such as # of Students and would like to sort by this in descending order. Here is my code:
...
dt.Columns.Add(new DataColumn("# of Students", typeof(string)));
// d...
Nkrumah asked 10/4, 2012 at 0:22
3
Solved
I am retrieving data from an MSSQL server using the SqlDataAdapter and DataSet. From that DataSet I am creating a DataTable. My goal is to convert each column of the table into a string where the e...
Original asked 21/4, 2011 at 21:17
2
I have a Datatable with many columns, and a datagrid in which I need to display only a few of those columns. I need a codesample of how to do it. I found a whole bunch of examples telling me to tur...
Pacificia asked 2/9, 2010 at 17:37
1
Solved
I have a DataTable that has several DataColumns and DataRow. Now i would like to handle an event when cell of this DataRow is changed. How to do this in c#?
Exodontist asked 10/11, 2009 at 13:39
1
© 2022 - 2025 — McMap. All rights reserved.