J
jayson_13
hi,
I want to create a public array that can be accessible through the
same class. But the problem is the size of that array is unknown until
some method in the same class has been called.
How can i do it?
private int[] CategoryID;
private void FillDataSet()
{
...
int[] CategoryID = new int[dataset1.Tables[0].Rows.Count];
}
private void InsertData
{
Cmd.Parameters.Add(new OdbcParameter("pCatID", OdbcType.Int,
5)).Value = CategoryID[cmbSubCatCategoryID.SelectedIndex];
}
How can i achieve this?
Thanks!
I want to create a public array that can be accessible through the
same class. But the problem is the size of that array is unknown until
some method in the same class has been called.
How can i do it?
private int[] CategoryID;
private void FillDataSet()
{
...
int[] CategoryID = new int[dataset1.Tables[0].Rows.Count];
}
private void InsertData
{
Cmd.Parameters.Add(new OdbcParameter("pCatID", OdbcType.Int,
5)).Value = CategoryID[cmbSubCatCategoryID.SelectedIndex];
}
How can i achieve this?
Thanks!