• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 446
  • Last Modified:


Using the Add new data source, when it came to Choose your Database object I chose a table called tbUsuaruio with 3 fields IdUsuario, Login and Senha, and A dataset Mala2Dataset containing the tbUsiario was created.
I Draged the Table in the format of a grid into the form.
the mala2DataSet.xsd together with the 5 standard components where created
Program work Ok.
with an InputBox I ask to enter a name (the field of login) and call the answer as Vuser.
I add Stored Procedure to the tbUsuarioTableAdapter and call it dp_fillbyLogin

CREATE PROCEDURE dbo.dp_fillbyLogin (      @Param1 varchar(16))
SELECT        IdUsuario, Login, Senha
FROM            tbUsuario
WHERE        (Login = @Param1)

Now I have an Sql query Fill,GetData() which works and

My question is: After the DataGridView displays all registers, when I click the inputbox and get the Vuser I haveto use a query that acept the parameter and I do not see how to do it.

I believe that I should have some thing like:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim vuser As String
        vuser = InputBox("Enter your user name")
        Me.TbUsuarioTableAdapter.FillBy(Me.Mala2DataSet.tbUsuarioDataTable, param1 = vuser).............................
    End Sub

Appreciate  help
Dov Kruman
  • 3
  • 2
1 Solution
Did you try the above code?
dovk179Author Commented:
yes, I did

And the result was ...
dovk179Author Commented:
Ok, the problem was in the parameter properties, it as char. I changed it to varchar and it works like charm

dovk179Author Commented:
by the comment I received I understood that it should work analyzing it a little more I concluded that I am trying to use small strings I a big  field size so I entered the parameter properties and sow that the parameter type was Char I changed it to Varchar and the problem was solved
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now