Click here to Skip to main content
15,921,660 members
Home / Discussions / Database
   

Database

 
GeneralRe: help required Pin
Colin Angus Mackay28-May-05 12:43
Colin Angus Mackay28-May-05 12:43 
GeneralRe: help required Pin
Christian Graus29-May-05 12:21
protectorChristian Graus29-May-05 12:21 
Generalsql query Pin
varun8027-May-05 2:40
varun8027-May-05 2:40 
GeneralRe: sql query Pin
Colin Angus Mackay27-May-05 10:13
Colin Angus Mackay27-May-05 10:13 
GeneralProblem related to the use of SQLDMO Pin
Prashant N.Rana26-May-05 22:19
Prashant N.Rana26-May-05 22:19 
GeneralRe: Problem related to the use of SQLDMO Pin
jonathan1526-May-05 22:39
jonathan1526-May-05 22:39 
GeneralRe: Problem related to the use of SQLDMO Pin
Prashant N.Rana29-May-05 17:41
Prashant N.Rana29-May-05 17:41 
GeneralInserting sql data Pin
NormBohana26-May-05 14:40
NormBohana26-May-05 14:40 
I am kind of stuck on stupid, and need some help. The following code works only once and then I get and error because of multi '@Param' use. I coded it this way because of the need to do some conversions as you can see. Can someone tell me how to code this in the correct way? I am new at this kind of code.

Norm

try
{

sqlInsertCommand1.CommandText = "INSERT INTO services([service-code], [service-description] ,[large-animal-cost], [medium-animal-cost], [small-animal-cost])" +
" values(@Param1,@Param2,@Param3, @Param4,@Param5) SELECT @@IDENTITY";

SqlParameter param = sqlInsertCommand1.Parameters.Add("@Param1",SqlDbType.Int);
param.Value = txtServiceCode.Text;

param = sqlInsertCommand1.Parameters.Add("@Param2",SqlDbType.VarChar);
param.Value = txtServiceDesc.Text;

param = sqlInsertCommand1.Parameters.Add("@Param3",SqlDbType.Money);
param.Value = Convert.ToDecimal(cbLargeAnimalCost.Text);

param = sqlInsertCommand1.Parameters.Add("@Param4",SqlDbType.Money);
param.Value = Convert.ToDecimal(cbMediumAnimalCost.Text);

param = sqlInsertCommand1.Parameters.Add("@Param5",SqlDbType.Money);
param.Value = Convert.ToDecimal(cbSmallAnimalCost.Text);

sqlInsertCommand1.Connection = sqlConnection1;
if (sqlConnection1.State != ConnectionState.Open)
sqlConnection1.Open();
sqlInsertCommand1.ExecuteNonQuery();


nbohana

GeneralRe: Inserting sql data Pin
Colin Angus Mackay26-May-05 23:46
Colin Angus Mackay26-May-05 23:46 
GeneralMany to Many Relations Pin
mjackson1126-May-05 10:13
mjackson1126-May-05 10:13 
GeneralRe: Many to Many Relations Pin
Colin Angus Mackay26-May-05 23:50
Colin Angus Mackay26-May-05 23:50 
GeneralRe: Many to Many Relations Pin
mjackson1127-May-05 2:13
mjackson1127-May-05 2:13 
GeneralCrystal reports memory issue Pin
Jason Stamp25-May-05 23:32
Jason Stamp25-May-05 23:32 
GeneralRe: Crystal reports memory issue Pin
Lucy Kaplan26-May-05 0:20
Lucy Kaplan26-May-05 0:20 
GeneralRe: Crystal reports memory issue Pin
jonathan1526-May-05 1:43
jonathan1526-May-05 1:43 
GeneralRe: Crystal reports memory issue Pin
Anonymous26-May-05 3:37
Anonymous26-May-05 3:37 
GeneralRe: Crystal reports memory issue Pin
jonathan1526-May-05 3:44
jonathan1526-May-05 3:44 
Questionhow to setup the database? Pin
tudou25-May-05 21:24
tudou25-May-05 21:24 
AnswerRe: how to setup the database? Pin
Christian Graus28-May-05 12:18
protectorChristian Graus28-May-05 12:18 
GeneralDataset question Pin
Timothy_198225-May-05 20:20
Timothy_198225-May-05 20:20 
GeneralRe: Dataset question Pin
Christian Graus28-May-05 12:21
protectorChristian Graus28-May-05 12:21 
Questionhow i can access to the start menu of the server and open the enteprize manager? Pin
Anonymous25-May-05 8:29
Anonymous25-May-05 8:29 
AnswerRe: how i can access to the start menu of the server and open the enteprize manager? Pin
Colin Angus Mackay25-May-05 12:58
Colin Angus Mackay25-May-05 12:58 
GeneralNeed help with sql MSDE deployment toolkit and installer class in vb.net Pin
Joey Picerno25-May-05 4:04
Joey Picerno25-May-05 4:04 
General*.mdb create table Pin
buraqenigma25-May-05 3:23
buraqenigma25-May-05 3:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.