FindNodeBiFieldValue returns null - c#

Logics:
  - choose from the data table rows by the condition "expand = true";
  - perform a search for lines;
  - depending on the value of the string field, we find the node in the "tray list".
In the method ExpandCurentNode() in line
TreeListNode node = treeList1.FindNodeByFieldValue("NodeName", name);
we get null.
Question
Why FindNodeByFieldValue returns null?
Description
TreeList fill method DataBinding().
Property PopulateServiceColumns = true.
Connection Code
public void connect()
{
string catBD = #"с:\db\db.01.accdb";
string conBD = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0}", catBD);
OleDbConnection connection = new OleDbConnection(conBD);
connection.Open();
string query1 = "SELECT * FROM TableTreeViewNoAi_12";
OleDbCommand cmd1 = new OleDbCommand(query1, connection);
dt = new DataTable();
dt.Columns.Add("ID", typeof(int));
dt.Columns["ID"].AutoIncrement = true;
dt.Columns["ID"].AutoIncrementSeed = 44;
dt.Columns["ID"].AutoIncrementStep = 1;
dt.Columns.Add("PrID", typeof(int));
dt.Columns.Add("sorting", typeof(int));
dt.Columns.Add("NodeName", typeof(string));
dt.Columns.Add("Description", typeof(string));
dt.Columns.Add("Comment", typeof(string));
dt.Columns.Add("dateN", typeof(string));
dt.Columns.Add("Cost", typeof(int));
dt.Columns.Add("typeRecord", typeof(string));
dt.Columns.Add("stImageInd", typeof(int));
dt.Columns.Add("expand", typeof(bool));
dt.Columns.Add("focus", typeof(bool));
try
{
adapter = new OleDbDataAdapter(cmd1);
cmdBuilder = new OleDbCommandBuilder(adapter);
adapter.UpdateCommand = cmdBuilder.GetUpdateCommand();
adapter.InsertCommand = cmdBuilder.GetInsertCommand();
}
catch (Exception ex)
{
string s = ex.Message;
throw;
}
adapter.Fill(dt);
dt.RowChanged += new DataRowChangeEventHandler(Row_Changed);
}
public void DataBinding()
{
// Чтобы отобразить поля "KeyFieldName" и "ParentFieldName"
// Свойство - PopulateServiceColumns = true
// Привязка к ключевым полям
treeList1This.KeyFieldName = "ID";
treeList1This.ParentFieldName = "PrID";
treeList1This.DataSource = dt;
// dataGridView1.DataSource = dt;
}
Form code
private void Frm29UC_Load(object sender, EventArgs e)
{
treeList1.BestFitColumns(); // расширить поля
ExpandCurentNode(); // восстановление дерева после открытия
}
public void ExpandCurentNode() // Восстановление состояния после открытия дерева
{
var selectedDt = conectDB.dt.Select("expand = true"); // DataTable.Select
int i = selectedDt.Length;
foreach (var b in selectedDt)
{
string name = b["NodeName"].ToString();
TreeListNode node = treeList1.FindNodeByFieldValue("NodeName", name); // +- string s = node.GetValue("NodeName").ToString();
node.Expand();
ExpandParentNode(node);
}
}

Ensure that TreeList is completely initialized when calling the ExpandCurentNode method. For this, call the TreeList.ForceInitialize method prior your method.

Related

How do you get a sqlite table schema using a query in c#

I have been searching high and low, using many methods to get a table schema from a table in sqlite. Please forgive me if this has been posted somewhere else.
Current query is
SELECT TOP (0) * FROM 'TableName'
but this returns nothing.
SELECT * FROM 'TableName'
also returns nothing if the table is empty.
I also used SQLiteConnection.GetSchema() but it doesn't return the table in question; it returns a table with other columns.
DataTable dtReturnTable = new DataTable();
sqlitecon.Open();
string[] sParameters = new string[4];
sParameters[2] = sTableName;
dtReturnTable = sqlitecon.GetSchema("Columns", sParameters);
sqlitecon.Close();
So what I did was this
private DataTable GetSQLiteTableWithQuery(string sQuery)
{
SQLiteConnection sqlconlocal = new SQLiteConnection(sSQLITEconnstring);
DataTable dtReturnTable = new DataTable();
SQLiteCommand sqliteCommand = new SQLiteCommand(sQuery, sqlconlocal);
using (sqlconlocal)
{
try
{
sqlconlocal.Open();
SQLiteDataReader sqliteReader = sqliteCommand.ExecuteReader();
if (sqliteReader.HasRows)
{
for (int i = 0; i < sqliteReader.FieldCount; i++)
{
dtReturnTable.Columns.Add(new DataColumn(sqliteReader.GetName(i)));
}
}
int j = 0;
while (sqliteReader.Read())
{
DataRow dtRow = dtReturnTable.NewRow();
dtReturnTable.Rows.Add(dtRow);
for (int i = 0; i < sqliteReader.FieldCount; i++)
{
dtReturnTable.Rows[j][i] = (sqliteReader.GetValue(i));
}
j++;
}
sqlconlocal.Close();
}
catch (SQLiteException e)
{
sqlconlocal.Close();
}
}
return dtReturnTable;
}
public DataTable GetSQLiteSchema(string sTableName)
{
string sQuery = "PRAGMA table_info('" + sTableName + "')";
DataTable dtWorking = GetSqLiteTableBasedOnQuery(sQuery);
DataTable dtReturn = new DataTable();
foreach (DataRow dr1 in dtWorking.Rows)
{
string sColName = dr1[1].ToString();
string sColtype = dr1[2].ToString();
if (sColtype.ToLower().Contains("nvarchar"))
{
dtReturn.Columns.Add(sColName, typeof(string));
}
else if (sColtype.ToLower().Contains("decimal"))
{
dtReturn.Columns.Add(sColName, typeof(decimal));
}
else if (sColtype.ToLower().Contains("int"))
{
dtReturn.Columns.Add(sColName, typeof(int));
}
else if (sColtype.ToLower().Contains("date"))
{
dtReturn.Columns.Add(sColName, typeof(DateTime));
}
else if (sColtype.ToLower().Contains("bit"))
{
dtReturn.Columns.Add(sColName, typeof(bool));
}
}
return dtReturn;
}

populating a datatable using linq to sql and stored procedure in asp.net

public void populatetransaction()
{
TRANASACTIONHISTRORYDataContext th = new TRANASACTIONHISTRORYDataContext();
DataTable dt = new DataTable();
var query = from dr
in th.TRANSACTIONSP((System.Nullable<long>)Convert.ToInt32(hidreference.Value))
select dr;
dt = (DataTable)query;
}
here is my code in that th.TRANSACTIONSP((System.Nullable<long>)Convert.ToInt32(hidreference.Value))
is the procedure calling how can i do that
public void populatetransaction()
{
TRANASACTIONHISTRORYDataContext th = new TRANASACTIONHISTRORYDataContext();
DataTable dt = new DataTable();
var query= th.TRANSACTIONSP((System.Nullable<long>)Convert.ToInt32(hidreference.Value));
DataColumn dc1 = dt.Columns.Add("BTC", typeof(string));
dc1.AllowDBNull = true;
DataColumn dc2 = dt.Columns.Add("TRANSACTIONDATE", typeof(DateTime));
dc2.AllowDBNull = true;
DataColumn dc3 = dt.Columns.Add("TRANSACTIONSTATUS", typeof(string));
DataRow dw ;
dc3.AllowDBNull = true;
foreach (var c in query)
{
dw=dt.NewRow();
dw["BTC"] = c.BTC;
dw["TRANSACTIONDATE"] = c.TRANSACTIONDATE;
dw["TRANSACTIONSTATUS"] = c.TRANSACTIONSTATUS;
dt.Rows.Add(dw);
}
}
This was what I want

C# Combobox and DataGridView

I've got a combobox which retrieve data from a select and a datagridview which retrieve data from another query. I would like to filter the datagridview using the comboboxvalue. I am trying everything but nothing work. Could you please help? Moreover, why when I declare dataview=((DataTable)datagridview.datasource.defaultview (first row in combobox_SelectedIndexChanged ) I can't see any values in the combobox anymore, instead I see System Data DataRowView but the first question is more important for me
private void Form5_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(#"Data Source=xxxxx;Initial Catalog=xxxxx;Integrated Security=True;");
conn.Open();
SqlCommand sc = new SqlCommand(" SELECT id, customername+' - '+cast(inserted as varchar(19)) as targ FROM bf where customername>'a' order by customername asc, inserted desc ", conn);
SqlDataReader reader;
reader = sc.ExecuteReader();
DataTable dt = new DataTable();
dt.Columns.Add("id", typeof(string));
dt.Columns.Add("targ", typeof(string));
dt.Load(reader);
comboBox1.ValueMember = "id";
comboBox1.DisplayMember = "targ";
comboBox1.DataSource = dt;
conn.Close();
var select = "SELECT [id],[CustomerName[email],[Capital] FROM baf order by id desc";
var c = new SqlConnection("Data Source=xxxxxx;Initial Catalog=xxxxx;Integrated Security=True;"); // Your Connection String here
var dataAdapter = new SqlDataAdapter(select, c);
var commandBuilder = new SqlCommandBuilder(dataAdapter);
var ds = new DataSet();
dataAdapter.Fill(ds);
dataGridView1.ReadOnly = true;
dataGridView1.DataSource = ds.Tables[0];
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
//var dataView = ((DataTable)dataGridView1.DataSource).DefaultView;
// if (comboBox1.Text == "Remove filter")
// {
// dataView.RowFilter = string.Empty;
// }
// else
// {
// //dataView.RowFilter = "id = {comboBox1.Text}";
// }
//}
}
You need to properly use BindingSource for the purpose. Below is the complete working example. To experiment with it what you need is as under:
Create a blank form Q1
Add one DataGridView control and one ComboBox control to the form
Copy paste below code into Q1.cs file
Run and experiment
I hope this will get you going nicely.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WinFormQ
{
public partial class Q1 : Form
{
public Q1()
{
InitializeComponent();
}
BindingSource bs;
private void Q1_Load(object sender, EventArgs e)
{
// SqlConnection conn = new SqlConnection(#"Data Source=xxxxx;Initial Catalog=xxxxx;Integrated Security=True;");
// conn.Open();
// SqlCommand sc = new SqlCommand(" SELECT id, customername+' - '+cast(inserted as varchar(19)) as targ FROM bf where customername>'a' order by customername asc, inserted desc ", conn);
// SqlDataReader reader;
//
// reader = sc.ExecuteReader();
DataTable dt = new DataTable();
dt.Columns.Add("id", typeof(string));
dt.Columns.Add("targ", typeof(string));
// dt.Load(reader);
dt.Rows.Add("1", "Targ-1"); // example code - remove
dt.Rows.Add("2", "Targ-2"); // example code - remove
dt.Rows.Add("3", "Targ-3"); // example code - remove
dt.Rows.Add("4", "Targ-4"); // example code - remove
comboBox1.ValueMember = "id";
comboBox1.DisplayMember = "targ";
comboBox1.DataSource = dt;
// var select = "SELECT [id],[CustomerName[email],[Capital] FROM baf order by id desc";
// var c = new SqlConnection("Data Source=xxxxxx;Initial Catalog=xxxxx;Integrated Security=True;"); Your Connection String here
// var dataAdapter = new SqlDataAdapter(select, c);
// var commandBuilder = new SqlCommandBuilder(dataAdapter);
DataSet ds = new DataSet();
DataTable bf = new DataTable("BF");
bf.Columns.Add("id", typeof(string)); // example code - remove
bf.Columns.Add("CustomerName", typeof(string)); // example code - remove
bf.Columns.Add("Email", typeof(string)); // example code - remove
bf.Columns.Add("Capital", typeof(string)); // example code - remove
ds.Tables.Add(bf);
bs = new BindingSource(ds, "BF");
// dataAdapter.Fill(bf);
bf.Rows.Add("1", "Customer-1", "Email-1", "Capital-1"); // example code - remove
bf.Rows.Add("1", "Customer-2", "Email-2", "Capital-1"); // example code - remove
bf.Rows.Add("2", "Customer-3", "Email-3", "Capital-2"); // example code - remove
bf.Rows.Add("3", "Customer-4", "Email-4", "Capital-3"); // example code - remove
bf.Rows.Add("3", "Customer-5", "Email-5", "Capital-3"); // example code - remove
bf.Rows.Add("3", "Customer-6", "Email-6", "Capital-3"); // example code - remove
bf.Rows.Add("4", "Customer-7", "Email-7", "Capital-4"); // example code - remove
dataGridView1.ReadOnly = true;
dataGridView1.DataSource = bs;
this.comboBox1.SelectedIndexChanged += new EventHandler(comboBox1_SelectedIndexChanged);
}
void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBox1.Text == "Remove filter")
{
bs.RemoveFilter();
}
else if (comboBox1.SelectedValue == null)
{
bs.RemoveFilter();
}
else
{
bs.Filter = "id = " + comboBox1.SelectedValue;
}
}
}
}
I resolved in this way (maybe not the most elegant but it does work):
private void Form5_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(#"Data Source=xxxxx;Initial Catalog=xxxxx;Integrated Security=True;");
conn.Open();
SqlCommand sc = new SqlCommand(" SELECT id, customername+' - '+cast(inserted as varchar(19)) as targ FROM baf where customername>'a' order by customername asc, inserted desc ", conn);
SqlDataReader reader;
reader = sc.ExecuteReader();
DataTable dt = new DataTable();
dt.Columns.Add("id", typeof(string));
dt.Columns.Add("targ", typeof(string));
dt.Load(reader);
comboBox1.ValueMember = "id";
comboBox1.DisplayMember = "targ";
comboBox1.DataSource = dt;
conn.Close();
var select = "SELECT [id],[CustomerName], [email],[CapActual] FROM baf order by id desc";
var c = new SqlConnection("Data Source=xxxx;Initial Catalog=xxxxx;Integrated Security=True;"); // Your Connection String here
var dataAdapter = new SqlDataAdapter(select, c);
var commandBuilder = new SqlCommandBuilder(dataAdapter);
var ds = new DataSet();
var bf = new DataTable("BF");
ds.Tables.Add(bf);
dataAdapter.Fill(bf);
dataGridView1.ReadOnly = true;
dataGridView1.DataSource = bf;
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
var select = "SELECT [id],[CustomerName],[email],[CapActual] FROM baf where id="+comboBox1.SelectedValue+" order by id desc";
var c = new SqlConnection("Data Source=xxxxx;Initial Catalog=xxxxxx;Integrated Security=True;"); // Your Connection String here
var dataAdapter = new SqlDataAdapter(select,c);
var commandBuilder = new SqlCommandBuilder(dataAdapter);
var ds = new DataSet();
var bf = new DataTable("BF");
ds.Tables.Add(bf);
dataAdapter.Fill(bf);
dataGridView1.ReadOnly = true;
dataGridView1.DataSource = bf;
}
}
}
For the viewers who are interested in finding how to make the code in question work successfully, I present the solution below. To achieve readiness to experiment, the data is hard coded which need be modified as per actual situation.
DataView dataView = null; // <<< Difference #1
private void Form1_Load(object sender, EventArgs e)
{
var dt = new DataTable();
dt.Columns.Add("id", typeof(string));
dt.Columns.Add("targ", typeof(string));
dt.Rows.Add("1", "Targ-1"); // example code - remove
dt.Rows.Add("2", "Targ-2"); // example code - remove
dt.Rows.Add("3", "Targ-3"); // example code - remove
dt.Rows.Add("4", "Targ-4"); // example code - remove
comboBox1.ValueMember = "id";
comboBox1.DisplayMember = "targ";
comboBox1.DataSource = dt;
var bf = new DataTable("BF");
bf.Columns.Add("id", typeof(string)); // example code - remove
bf.Columns.Add("CustomerName", typeof(string)); // example code - remove
bf.Columns.Add("Email", typeof(string)); // example code - remove
bf.Columns.Add("Capital", typeof(string)); // example code - remove
bf.Rows.Add("1", "Customer-1", "Email-1", "Capital-1"); // example code - remove
bf.Rows.Add("1", "Customer-2", "Email-2", "Capital-1"); // example code - remove
bf.Rows.Add("2", "Customer-3", "Email-3", "Capital-2"); // example code - remove
bf.Rows.Add("3", "Customer-4", "Email-4", "Capital-3"); // example code - remove
bf.Rows.Add("3", "Customer-5", "Email-5", "Capital-3"); // example code - remove
bf.Rows.Add("3", "Customer-6", "Email-6", "Capital-3"); // example code - remove
bf.Rows.Add("4", "Customer-7", "Email-7", "Capital-4"); // example code - remove
dataGridView1.ReadOnly = true;
dataGridView1.DataSource = bf;
dataView = bf.DefaultView; // <<< Difference #2
this.comboBox1.SelectedIndexChanged += new EventHandler(comboBox1_SelectedIndexChanged); // <<< Difference #3
}
void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBox1.Text == "Remove filter")
{
dataView.RowFilter = string.Empty;
}
else
{
dataView.RowFilter = string.Format("id = '{0}'", comboBox1.SelectedValue); // <<< Difference #4
}
}

import Excel to DataTable with Asp.net

When I use excel table import to Data Table, at the same time need to import SID, CREATE_DATETIME, MODIFY_DATETIME, CREATOR_SID(actorSId)...
But after import i just getting excel data. So How can i import at the same time ?
My Code is here;
private void BindData(string strConn)
{
OleDbConnection objConn = new OleDbConnection(strConn);
objConn.Open();
// Get the data table containg the schema guid.
DataTable dt = null;
dt = objConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
objConn.Close();
//ISystemId SID
if (dt.Rows.Count > 0)
{
// Bind the sheets to the Grids
foreach (DataRow row in dt.Rows)
{
DataTable dt_sheet = null;
dt_sheet = getSheetData(strConn, row["TABLE_NAME"].ToString());
}
}
}
private DataTable getSheetData(string strConn, string sheet)
{
string sid = Convert.ToString(new SystemId());
string Ctime = Convert.ToDateTime(DateTime.Now).ToString("yyyyMMddhhmmss");
string Mtime = Convert.ToDateTime(DateTime.Now).ToString("yyyyMMddhhmmss");
string actorSId = Convert.ToString(WebPage.CurrentSysUserSId);
string query = "select * from [" + sheet + "]";
OleDbConnection objConn;
OleDbDataAdapter oleDA;
DataTable dt = new DataTable();
dt.Columns.Add("SID", typeof(string));
dt.Columns.Add("CREATE_DATETIME", typeof(string));
dt.Columns.Add("MODIFY_DATETIME", typeof(string));
dt.Columns.Add("CREATOR_SID", typeof(string));
dt.Columns.Add("MODIFIER_SID", typeof(string));
dt.Columns.Add("MARK_DELETED", typeof(string));
dt.Columns.Add("ENABLED", typeof(string));
dt.Columns.Add("SORT", typeof(int));
objConn = new OleDbConnection(strConn);
objConn.Open();
oleDA = new OleDbDataAdapter(query, objConn);
oleDA.Fill(dt);
objConn.Close();
oleDA.Dispose();
objConn.Dispose();
return dt;
}
So, who can help me ?
I`m already solved my problem.
Changed below code than working clearly.
private DataTable getSheetData(string strConn, string sheet)
{
//string sid = Convert.ToString(new SystemId());
string Ctime = Convert.ToDateTime(DateTime.Now).ToString("yyyyMMddhhmmss");
string Mtime = Convert.ToDateTime(DateTime.Now).ToString("yyyyMMddhhmmss");
string actorSId = Convert.ToString(WebPage.CurrentSysUserSId);
string query = "select * from [" + sheet + "]";
OleDbConnection objConn;
OleDbDataAdapter oleDA;
DataTable dt = new DataTable();
dt.Columns.Add("SID", typeof(string));
dt.Columns.Add("CREATE_DATETIME", typeof(string));
dt.Columns.Add("MODIFY_DATETIME", typeof(string));
dt.Columns.Add("CREATOR_SID", typeof(string));
dt.Columns.Add("MODIFIER_SID", typeof(string));
dt.Columns.Add("MARK_DELETED", typeof(string));
dt.Columns.Add("ENABLED", typeof(string));
dt.Columns.Add("SORT", typeof(int));
objConn = new OleDbConnection(strConn);
objConn.Open();
DataSet dataSet = new DataSet();
oleDA = new OleDbDataAdapter(query, objConn);
oleDA.Fill(dt);
foreach (DataRow dr in dt.Rows) // search whole table
{
for (int i = 0; i < dt.Rows.Count - 1; i++)
if (dt.Rows.Count > i)
{
string sid = Convert.ToString(new SystemId());
var row = dt.Rows[i];
row["SID"] = sid;
row["CREATE_DATETIME"] = Ctime;
row["MODIFY_DATETIME"] = Mtime;
row["CREATOR_SID"] = actorSId;
row["MODIFIER_SID"] = 0;
row["MARK_DELETED"] = "N";
row["ENABLED"] = "Y";
row["SORT"] = 1;
}
}
objConn.Close();
oleDA.Dispose();
objConn.Dispose();
return dt;
}

Not getting values in datatable while Updating gridview row

I have 5 rows in gridview in which I am trying to update one row, While updating, I wrote below code:-
protected void GrdProspective1_UpdateCommand(object sender, Obout.Grid.GridRecordEventArgs e)
{
if (Session["grdEdit"] != null)
{
DtCombo = (DataTable)Session["grdEdit"];
}
else
{
BindDatatable();
}
DataRow[] dataProsUpdate = DtCombo.Select("SR_NO = " + e.Record["SR_NO"]);
dataProsUpdate[0]["PARTY_NAME"] = e.Record["PARTY_NAME"];
dataProsUpdate[0]["FLAT_NO"] = e.Record["FLAT_NO"];
dataProsUpdate[0]["LEASE_NUM"] = e.Record["LEASE_NUM"];
dataProsUpdate[0]["ACTION"] = e.Record["ACTION"];
dataProsUpdate[0]["NO_OF_DAYS"] = e.Record["NO_OF_DAYS"];
dataProsUpdate[0]["REMARKS"] = e.Record["REMARKS"];
GrdProspective1.DataSource = DtCombo;
GrdProspective1.DataBind();
AddToViewState("GrdProspective1");
}
But in this, I am getting error as
Index was outside the bounds of the array.
I am confused why datatable is emppty when there are 5 rows in the gridview
My datatable code:-
public void BindDatatable()
{
DataSet ds = new DataSet();
DataRow dr;
DataColumn SR_NO;
DataColumn PARTY_NAME;
DataColumn FLAT_NO;
DataColumn LEASE_NUM;
DataColumn ACTION;
DataColumn NO_OF_DAYS;
DataColumn REMARKS;
DtCombo = new DataTable();
SR_NO = new DataColumn("SR_NO", typeof(Int32));
PARTY_NAME = new DataColumn("PARTY_NAME", typeof(String));
FLAT_NO = new DataColumn("FLAT_NO", typeof(Int32));
LEASE_NUM = new DataColumn("LEASE_NUM", typeof(Int32));
ACTION = new DataColumn("ACTION", typeof(String));
NO_OF_DAYS = new DataColumn("NO_OF_DAYS", typeof(Int32));
REMARKS = new DataColumn("REMARKS", typeof(String));
DtCombo.Columns.Add(SR_NO);
DtCombo.Columns.Add(PARTY_NAME);
DtCombo.Columns.Add(FLAT_NO);
DtCombo.Columns.Add(LEASE_NUM);
DtCombo.Columns.Add(ACTION);
DtCombo.Columns.Add(NO_OF_DAYS);
DtCombo.Columns.Add(REMARKS);
}
Complete solution:
protected void GrdProspective1_UpdateCommand(object sender, Obout.Grid.GridRecordEventArgs e)
{
if (Session["grdEdit"] != null)
{
DtCombo = (DataTable)Session["grdEdit"];
}
else
{
return;
}
DataRow[] dataProsUpdate = DtCombo.Select("SR_NO = " + e.Record["SR_NO"]);
dataProsUpdate[0]["PARTY_NAME"] = e.Record["PARTY_NAME"];
dataProsUpdate[0]["FLAT_NO"] = e.Record["FLAT_NO"];
dataProsUpdate[0]["LEASE_NUM"] = e.Record["LEASE_NUM"];
dataProsUpdate[0]["ACTION"] = e.Record["ACTION"];
dataProsUpdate[0]["NO_OF_DAYS"] = e.Record["NO_OF_DAYS"];
dataProsUpdate[0]["REMARKS"] = e.Record["REMARKS"];
GrdProspective1.DataSource = DtCombo;
GrdProspective1.DataBind();
AddToViewState("GrdProspective1");
}
public void DisplayGridEdit()
{
OracleCommand cmd = new OracleCommand("SELECT...", ObjPriCon);
DtCombo = new DataTable();
OracleDataAdapter da = new OracleDataAdapter(cmd);
da.Fill(DtCombo);
GrdProspective1.DataSource = DtCombo;
GrdProspective1.DataBind();
AddToViewState("GrdProspective1");
}

Categories

Resources