100分!跪求以下C#代码转为VB.Net
private void button1_Click(object sender, System.EventArgs e)
{
int rows = Int16.Parse(textBox1.Text);//行数
int cols = Int16.Parse(textBox2.Text);//列数
string[][] data = new string[rows][];
int i, j;
for(i = 0 ; i < rows ; i ++)
{
data[i] = new string[cols];
for(j = 0 ; j < cols ; j ++)
{
data[i][j] = i.ToString() + ", " + j.ToString();
}
}
DataTable dt = new DataTable();
for(j = 0 ; j < cols ; j ++)
{
dt.Columns.Add( "列名 "+j.ToString(), typeof(string));
}
for(i = 0 ; i < rows ; i ++)
{
dt.Rows.Add(data[i]);
}
dataGrid1.DataSource = dt;
}
------解决方案--------------------Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim rows As Integer = Int16.Parse(textBox1.Text)
Dim cols As Integer = Int16.Parse(textBox2.Text)
Dim data(rows)() As String
Dim i As Integer
Dim j As Integer
i = 0
i = 0
While i < rows
data(i) = New String(cols) {}
j = 0
j = 0
While j < cols
data(i)(j) = i.ToString + ", " + j.ToString
System.Math.Min(System.Threading.Interlocked.Increment(j),j-1)