Quantcast
Viewing all articles
Browse latest Browse all 10

INSERT Queries

INSERT Example


	String ^sTemp = "INSERT INTO myTable (	\
					SomeValueColumn,	\
					SomeStringColumn	\
				) Values (					\
				@SomeValue,					\
				@SomeString					\
				)";
	Command1->CommandText = sTemp;
	//Strings should be added as parameters to avoid sanatisation risks unless you know they are safe.
	//Other values can be added as parameters too or inline in the INSERT text.
	Command1->Parameters->AddWithValue("@SomeValue", 1234);
	Command1->Parameters->AddWithValue("@SomeString", "Hello");

	Command1->ExecuteNonQuery();

 


Viewing all articles
Browse latest Browse all 10

Trending Articles