Add Row to Dataset Table /DataTable

DataSet dsFields = new DataSet();

string strQry = @” SELECT * FROM XYZ”;

// Settings.ConnectionString is where the Connection String is stored.

dsFields = OracleHelper.ExecuteDataset(Settings.ConnectionString, CommandType.Text, strQry);

DataRow newRow = dsFields.Tables[0].NewRow();

// Here I am adding only one column for presentation purpose.

// You can add columns as per your requirments.

newRow [“ColumnName”] = “ColumnName”;

newRow [“ColumnValue”] = “ColumnValue”;

// Adding row to Dataset-Table


We can do similar way for DataTable also just replace dsFields.Tables[0] with your DataTable Name


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s