How to Add dynamic value in insert query


#1

I have a problem when I am using paramenter in Excute Non Query Activity…
Any one give suggestion for that problem…
INSERT INTO tableName(name,password) VALUES (@name,@password)
In the above query,@name and @ password is a variable…
The above query shown NULL value in database

And Another Way,

“INSERT INTO tableName(name,password) VALUES (”+row(0).ToString+","+row(1).ToString+")"
The above query will Shown Exception like “Newtonsoft.json”


#2

Hello!

Are you using the query inside a For Each Loop?

If yes, then try something like this:

“INSERT INTO tableName(name,password) VALUES (”&row.Item(0).ToString&","&row.Item(1).ToString&")"

If not, then try something like this:

“INSERT INTO tableName(name,password) VALUES (”&datatable.Rows(0).Item(0).ToString&","&datatable.Rows(0).Item(1).ToString&")"

Let me know if works.

Regards,


#3

Thank you for Suggestion…
But still Shown Error Like Compilation Error
I am trying both of your query…Same Error Appear on Screen???