This is a migrated thread and some comments may be shown as answers.

Insert into Sql Server Database?

1 Answer 132 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 10 Feb 2012, 09:14 PM
In order to get around not being able to manipulate flash objects, I decided create inserts in the backend since we are not concerned with how the flash object operates, but it is essential to our product.  

 

thisCommand.CommandText = "INSERT INTO TEST VALUES('TEST')"
(Test table only has 1 column)

 


For some reason I can't write into a sql server database from Telerik.  I have been able to read  though.  The line of code above does nothing and script step still passes.  I have used the same connection string and command in a .vb file and have been able to insert.  Is there something that I am missing?

Thanks,

Jonathan


1 Answer, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 13 Feb 2012, 04:48 PM
Hi Jonathan,
I've expanded out article on accessing an SQL DB. It now includes an example demonstrating how to write into an SQL db (near bottom of article). Check it out here:
http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/code-samples/general/access-sql-database.aspx

The example is correct - I tested it out. Just make sure that you're working with the right value type. For instance I had defined my column as consisting of nchar(10) values. This means that the string values that it holds exceed 10 characters. At first my code was failing because I was trying to write a String that bigger than that. Just something to keep in mind.

Let me know if you're still unable to get this to work.

All the best,
Stoich
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Share this question
or