Click here to Skip to main content
15,915,600 members
Home / Discussions / Database
   

Database

 
GeneralRe: Recordset Open method error IDispatch error #3121 Pin
flyflyfly1-Dec-05 6:19
flyflyfly1-Dec-05 6:19 
GeneralRe: Recordset Open method error IDispatch error #3121 Pin
Farhan Noor Qureshi1-Dec-05 7:20
Farhan Noor Qureshi1-Dec-05 7:20 
GeneralRe: Recordset Open method error IDispatch error #3121 Pin
flyflyfly1-Dec-05 7:49
flyflyfly1-Dec-05 7:49 
GeneralRe: Recordset Open method error IDispatch error #3121 Pin
Farhan Noor Qureshi1-Dec-05 8:55
Farhan Noor Qureshi1-Dec-05 8:55 
QuestionFailed to compare Time portion of DateTime when read ACCESS database Pin
Roman Muntyanu29-Nov-05 8:35
Roman Muntyanu29-Nov-05 8:35 
QuestionMSDE and SQL SErver Express 2005 Pin
inphone29-Nov-05 4:52
inphone29-Nov-05 4:52 
AnswerRe: MSDE and SQL SErver Express 2005 Pin
Paul Conrad29-Nov-05 5:07
professionalPaul Conrad29-Nov-05 5:07 
QuestionInserting a record into a database with a front web form Pin
bhumber29-Nov-05 1:45
bhumber29-Nov-05 1:45 
The code below should insert this record into the database, I don't the error. I drops through and run the line that enables the btnAdd.Enable = true. How do I fix it?

private void SaveRecord()
{
string strSQL;

if(btnSave.CommandArgument == "Add")
{
strSQL =
"INSERT INTO CoinCollection " +
" (ID, TypeOfCoin, YearOfCoin, StateOfCoin, DateReceive)" +
"VALUES " +
" (@ID, @TypeOfCoin, @YearOfCoin, @StateOfCoin, @DateReceive)";
}
else
{
// The user is updating an existing item
strSQL =
"UPDATE CoinCollection " +
" SET TypeOfCoin = @TypeOfCoin, " +
" YearOfCoin = @YearOfCoin, " +
" StateOfCoin = @StateOfCoin, " +
" DateReceive = @DateReceive " +
"WHERE ID = @ID";
}

SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["connString"]);
SqlCommand cmSQL = new SqlCommand(strSQL, conn);

// Add all the requuired SQL Parmeters.
cmSQL.Parameters.Add(new SqlParameter("@ID", SqlDbType.Int)).Value = Convert.ToInt32(tbID.Text);
cmSQL.Parameters.Add(new SqlParameter("@TypeOfCoin", SqlDbType.VarChar, 50)).Value = tbToc.Text;
cmSQL.Parameters.Add(new SqlParameter("@YearOfCoin", SqlDbType.VarChar, 50)).Value = tbYoc.Text;
cmSQL.Parameters.Add(new SqlParameter("@StateOfCoin", SqlDbType.VarChar, 50)).Value = tbSoc.Text;
cmSQL.Parameters.Add(new SqlParameter("@DateReceive", SqlDbType.VarChar, 50)).Value = tbDr.Text;

try
{
conn.Open();
cmSQL.ExecuteNonQuery();
strMsg = "Coin successfully saved to the database.";
}
catch(Exception exp)
{
strErrorMsg = "Database error! Coins not saved to database. Error Message: " + exp.Message;
}
finally
{
conn.Close();
btnAdd.Enabled = true;
}
}


bhumber
AnswerRe: Inserting a record into a database with a front web form Pin
dwatkins@dirq.net29-Nov-05 11:06
dwatkins@dirq.net29-Nov-05 11:06 
QuestionWorking with only Time in Sql? Pin
majidbhutta29-Nov-05 1:00
majidbhutta29-Nov-05 1:00 
AnswerRe: Working with only Time in Sql? Pin
Farhan Noor Qureshi29-Nov-05 12:01
Farhan Noor Qureshi29-Nov-05 12:01 
QuestionSELECT @@IDENTITY doesn't work Pin
AndySummer28-Nov-05 22:27
AndySummer28-Nov-05 22:27 
AnswerRe: SELECT @@IDENTITY doesn't work Pin
Frank Kerrigan28-Nov-05 22:42
Frank Kerrigan28-Nov-05 22:42 
QuestionIs this Possible in sql? Pin
majidbhutta28-Nov-05 5:50
majidbhutta28-Nov-05 5:50 
AnswerRe: Is this Possible in sql? Pin
Farhan Noor Qureshi28-Nov-05 10:53
Farhan Noor Qureshi28-Nov-05 10:53 
QuestionWhich one is faster and recommended Pin
dabuskol28-Nov-05 1:12
dabuskol28-Nov-05 1:12 
AnswerRe: Which one is faster and recommended Pin
Farhan Noor Qureshi28-Nov-05 11:02
Farhan Noor Qureshi28-Nov-05 11:02 
QuestionAccess database - for website Pin
Rama Sharma28-Nov-05 1:11
Rama Sharma28-Nov-05 1:11 
AnswerRe: Access database - for website Pin
Farhan Noor Qureshi28-Nov-05 10:56
Farhan Noor Qureshi28-Nov-05 10:56 
GeneralRe: Access database - for website Pin
Paul Conrad28-Nov-05 11:37
professionalPaul Conrad28-Nov-05 11:37 
GeneralRe: Access database - for website Pin
Rama Sharma28-Nov-05 16:33
Rama Sharma28-Nov-05 16:33 
GeneralRe: Access database - for website Pin
Paul Conrad28-Nov-05 19:16
professionalPaul Conrad28-Nov-05 19:16 
AnswerRe: Access database - for website Pin
S Douglas28-Nov-05 21:06
professionalS Douglas28-Nov-05 21:06 
GeneralRe: Access database - for website Pin
Paul Conrad29-Nov-05 5:10
professionalPaul Conrad29-Nov-05 5:10 
GeneralRe: Access database - for website Pin
S Douglas29-Nov-05 5:36
professionalS Douglas29-Nov-05 5:36 

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.