shorten arg number ?? {Sorted by Edneeis}
I dunno how to explain this but I will try to be clear :
how can I declare array of textbox . I prefer you look at what I am trying to do :
VB Code:
Public Function Save(ByVal txt1 As TextBox, ByVal txt2 As TextBox, ByVal txt3 As TextBox, ByVal txt4 As TextBox, ByVal txt5 As TextBox, ByVal txt6 As TextBox, ByVal comb1 As ComboBox, ByVal comb2 As ComboBox)
MyAdapter.Fill(MyDataset, "MyTab")
Dim MyDataRow As DataRow = MyDataset.Tables("MyTab").NewRow
MyDataRow("C_URL") = txt1.Text
MyDataRow("C_Category") = comb1.Text
MyDataRow("C_language") = comb2.Text
MyDataRow("C_username") = txt3.Text
. txt4.Text
. txt5.Text
. txt6.Text
End Function
' Call it like so :
Save(TextBox1, TextBox2, TextBox3, TextBox4, TextBox5, TextBox6, ComboBox1, ComboBox2)
is there another way to shorten this by declaring a collection of textbox ? Is it possible or Do I need to sleep ?:rolleyes: