I need to send A Parameters And Variable From VB to Report Little Confuse with Knowledgebase

Stimulsoft Reports.NET discussion
Post Reply
gulitha_tit
Posts: 2
Joined: Wed Jan 19, 2011 12:55 pm
Location: Id

I need to send A Parameters And Variable From VB to Report Little Confuse with Knowledgebase

Post by gulitha_tit »

I such little more confuse after i read the knowledgebase to send a parameter to DataSource that I create On StiReport1 directly..

Case:
1. I Add StiReport1 on My VB Form, then I Choose Design Report From StiReport1.
2. Then I add connection (Name : VILLAGE)
3. Then I add DataSouce (Name : PEOPLE, With Name In Souce VILLAGE)
4. On Query Text I added SQL Query like This:
(Select Id, Name, Age, Address FROM Individu) - It's Work Fine
Then I change That Query like this:
(Select Id, Name, Age, Address FROM Individu WHERE Name LIKE '%' + @ScName + '%' - If I Click Retrieve Column I dont get any colum name on list...Than I add Parameter with Name @ScName, its same, I Dont get that column list...

When On VB Code I Use this:

StiReport1.DataSources("DaftarKK").Parameters("@ScName").ParameterValue = txtSearch.Text
StiReport1.Show()
I Get This error:
"OleDbCommand.Prepare method requires all variable length parameters to have an explicitly set non-zero Size."

Hemm:
How to add variable Value if I Have add a Variable on StiReport1 on Design Report with name "Name"
Then On VB I write code:
StiReport1.Item("Name") = txtName.Text, this is not work. WHY?


Sorry that I am not write full SQL Query because this Query too Long..
I Wait Your Replay as soon as possible.. :sweat: :surr:
gulitha_tit
Posts: 2
Joined: Wed Jan 19, 2011 12:55 pm
Location: Id

I need to send A Parameters And Variable From VB to Report Little Confuse with Knowledgebase

Post by gulitha_tit »

Sorry, error Writing:
StiReport1.DataSources("DaftarKK").Parameters("@ScName").ParameterValue = txtSearch.Text

Text that I Bold and Italic = PEOPLE correct..
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

I need to send A Parameters And Variable From VB to Report Little Confuse with Knowledgebase

Post by Alex K. »

Hello,

For OleDb connections you can use the following query:

Code: Select all

Select Id, Name, Age, Address FROM Individu WHERE Name LIKE '%' + ? + '%'
Thank you.
Post Reply