-
How do you add Web Methods in VB.Net
A) Add keyword to Method signatureB) Add [WebMethod] on top of the Method SignatureC) Add {WebMethod} on top of the Method Signature
-
Root NameSpace Of The .Net
Object
-
-
What is the corresponding datatype in VB.Net for variant in VB
A) ArrayB) ObjectC) ListD) String
-
-
To find out the role of the logged in user, you’ll use:
A) User.IsInRole(“Administrators”)B) User.Role(“Administrators”)C) UserRole(“Administrators”)
-
-
Value types represent simple data storage located on
A) StackB) HeapC) Managed Heap
-
-
-
What is the operation that you can not do with primitive types
A) Assign a value to primitive type using a literalB) Declare primitive types to be constant using the Const keywordC) Create a new instance of primitive type with New keywordExplanation: Instance creation is possible only with reference types
-
Which of the following is incorrect in .NET
A) System.Text.StringbuilderB) System.Collections.CollectionC) System.Data.oledb.oledbcommandD) Microsoft.VisualBasic.Vbmath
-
-
conn.Open()
cmd = New SqlCommand
Dim InsertString1 As String
Dim txt_batchno(i) As TextBox
txt_batchno(i) = New TextBox
'txt_batchno(n).Text = txtbatchno.Text
n = txt_nos.Text
' For i = 0 To i = n - 1
'compvar(i) = txtbatchno.Text
' Next
' MsgBox("value of compvar(i)" & compvar(i).Item(i))
'MsgBox("value of compvar(i)" & compvar(1))
'For i = 0 To i = n - 1
i = 0
' If i <= n - 1 Then
' MsgBox("value of compvar(i)" compvar(i))
compvar(i).Item(i) = New ArrayList
Dim s1 As String
txt_batchno(i).ext = compvar(i).Item(i)
s1 = compvar(i).Add(txt_batchno(i).Text)
' MsgBox("value of compvar(i)" & compvar(i).Item(i))
txt_batchno(i).Text = s1 'compvar(i)compvar(i).Item(i).ToString
InsertString1 = "select * from brakedisc_info where batchno='" & txt_batchno(i).Text & "'" ' and batchno='" & txt_batchno(i + 1).Text & "'"
compareDS = New DataSet("compare")
DA = New SqlDataAdapter(InsertString1, conn)
DA.Fill(compareDS, "brakedisc_info")
DataGridView1.DataSource = compareDS.Tables(0)
'i = i + 1
' End If
'Next
End Sub
Private Sub btn_add_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_add.Click
conn = New SqlConnection("server=acer;initial catalog=breakdiskprocessdata;integrated security=sspi")
conn.Open()
n = txt_nos.Text
Dim InsertString1, s1 As String
Dim txt_batchno(i) As TextBox
txt_batchno(i) = New TextBox
Dim flag As Boolean
flag = True
i = 0
compvar(i) = New ArrayList
'For i = 0 To i = n - 1
If flag = True Then
If i <= n - 1 Then
compvar(i).Insert(i, txtbatchno.Text)
txtbatchno.Text = ""
Me.Show()
MsgBox("array contains:" & compvar(i).Item(i))
i = i + 1
End If
End If
' Next
' If i <= n - 1 Then
'flag = False
' If flag = False Then
'InsertString1 = "select * from brakedisc_info where batchno='" & txt_batchno(i).Text & "'" ' and batchno='" & txt_batchno(i + 1).Text & "'"
'MsgBox("value of compvar(i)" & compvar(i).Item(i))
' txt_batchno(i).Text = compvar(i).Item(i)
' InsertString1 = "select * from brakedisc_info where batchno='" & txt_batchno(i).Text & "'" ' and batchno='" & txt_batchno(i + 1).Text & "'"
' compareDS = New DataSet("compare")
' DA = New SqlDataAdapter(InsertString1, conn)
' DA.Fill(compareDS, "brakedisc_info")
' DataGridView1.DataSource = compareDS.Tables(0)
' End If
' End If
End Sub
End Class
Thanks in advance...
">How to assign and retrive values from array, arraylist dynamically........please see the questionWill enter the number of values to be inserted into array in one text boxex: n= txt_num.textand from another textbox I want to insert the 'n' values(ie varchar values)and then i want to retrive the values back such that i can use these values in select stmt of T-sql to retrive the data....and i want to display the data of all 'n' values in one table*here is the code.. for assigning and retriving pl chk this is the main prob...i can write T-sql part..........please helpImports System.Data.SqlClientImports System.DrawingPublic Class compare Dim n, i As Integer Dim compareDS As DataSet Dim compvar(i) As ArrayList Dim conn As SqlConnection Dim cmd As SqlCommand Dim DA As SqlDataAdapter Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click conn = New SqlConnection("server=acer;initial catalog=breakdiskprocessdata;integrated security=sspi") conn.Open() cmd = New SqlCommand Dim InsertString1 As String Dim txt_batchno(i) As TextBox txt_batchno(i) = New TextBox 'txt_batchno(n).Text = txtbatchno.Text n = txt_nos.Text ' For i = 0 To i = n - 1 'compvar(i) = txtbatchno.Text ' Next ' MsgBox("value of compvar(i)" & compvar(i).Item(i)) 'MsgBox("value of compvar(i)" & compvar(1)) 'For i = 0 To i = n - 1 i = 0 ' If i
-
-
-
-
-
Which of the following syntax is not allowed in VB.NET?
A) Sub End subB) { }C) ( )Explanation: Sub … EndSub is for enclosing method implementation & ( ) for enclosing the condition. But Flower brackets are not valid Syntax in Vb.Net
-
VB.NET Interview Questions
Ans