Function c# Load tables from sql 2000 -2005

October 18, 2008 at 10:03 am Leave a comment

public void Load_Tables()
{

dataSetPinakes.Tables[0].Clear();
System.Data.SqlClient.SqlCommand sqlcmdselect = new SqlCommand();
sqlcmdselect.CommandText = “select name, ‘0’ as see  from sysobjects where xtype=’U'” ;
sqlcmdselect.Connection = MSSqlcon;
System.Data.SqlClient.SqlDataAdapter sqlDataAdapter_kos = new SqlDataAdapter();
sqlDataAdapter_kos.SelectCommand = sqlcmdselect;

try
{
sqlDataAdapter_kos.Fill(dataSetPinakes.Tables[0]);

DataRow[] row_select = dataSetPinakes.Tables[0].Select();
cblPinakes.Items.Clear();
for (int bb = 0; bb < row_select.Length; bb++)
{

object obj = row_select[bb][0].ToString();
cblPinakes.Items.Add(obj);

}

DataTable dt = dataSetPinakes.Tables[0].Copy();
dt.Clear();
dt.ReadXml(“Tables.xml”);

DataRow[] rowsel = dt.Select();
for (int ii = 0; ii < rowsel.Length; ii++)
{
if (rowsel[ii][1].ToString() == “1”)
{
CheckItem(rowsel[ii][0].ToString());
}
}

}
catch (Exception ex)
{ MessageBox.Show(ex.ToString()); }

}

Advertisements

Entry filed under: c-sharp, Database. Tags: , , , , , , , , , , , , , , , , .

isIdentity sql query function checkitems combolbox list c-sharp

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com 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

Trackback this post  |  Subscribe to the comments via RSS Feed


October 2008
M T W T F S S
« Sep   Feb »
 12345
6789101112
13141516171819
20212223242526
2728293031  

%d bloggers like this: