Click here to Skip to main content
15,913,262 members
Home / Discussions / Database
   

Database

 
AnswerRe: what's wrong with this simple SQL statement? Pin
Bruce Duncan10-Feb-03 6:48
Bruce Duncan10-Feb-03 6:48 
GeneralRe: what's wrong with this simple SQL statement? Pin
devvvy10-Feb-03 11:17
devvvy10-Feb-03 11:17 
GeneralRe: what's wrong with this simple SQL statement? Pin
Bruce Duncan11-Feb-03 7:30
Bruce Duncan11-Feb-03 7:30 
GeneralRe: what's wrong with this simple SQL statement? Pin
devvvy11-Feb-03 15:30
devvvy11-Feb-03 15:30 
GeneralQuery From Column Name Pin
Mazdak9-Feb-03 23:33
Mazdak9-Feb-03 23:33 
GeneralRe: Query From Column Name Pin
karl_w10-Feb-03 6:27
karl_w10-Feb-03 6:27 
GeneralKeeping Database Connection Open Pin
ChrisDM9-Feb-03 2:21
ChrisDM9-Feb-03 2:21 
GeneralProblem with running stored procedure Pin
Mazdak8-Feb-03 1:41
Mazdak8-Feb-03 1:41 
I want to run stored procedure with some paraneters from my asp.net application.I use this code but I got run=time error at the last line:

SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);

//setting parameters for sp_Votes_GetVotes
SqlParameter[] parameters = 				
{
	new SqlParameter("@Table", SqlDbType.NVarChar , 50),
	new SqlParameter("@ID" , SqlDbType.BigInt , 8)
};
parameters[0].Value = Page.Request.Params["Cat"];
parameters[1].Value = int.Parse(Page.Request.Params["id"]);
//Set command and run it
SqlCommand command = new SqlCommand();

foreach (SqlParameter parameter in parameters)
{
command.Parameters.Add( parameter );
}

command.Connection = conn;
command.CommandType = System.Data.CommandType.StoredProcedure;
command.CommandText = "sp_Votes_GetVotes";

if(conn.State == System.Data.ConnectionState.Closed)
conn.Open();

SqlDataReader dr = command.ExecuteReader();


The error is:
Error converting data type nvarchar to bigint.


Mazy

"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me
-Tom Waits

QuestionWhat is wrong with these SQL statements?? Pin
IrishSonic8-Feb-03 0:37
IrishSonic8-Feb-03 0:37 
AnswerRe: What is wrong with these SQL statements?? Pin
Mazdak8-Feb-03 2:51
Mazdak8-Feb-03 2:51 
GeneralRe: What is wrong with these SQL statements?? Pin
karl_w8-Feb-03 3:01
karl_w8-Feb-03 3:01 
GeneralRe: What is wrong with these SQL statements?? Pin
Mazdak8-Feb-03 3:53
Mazdak8-Feb-03 3:53 
GeneralRe: What is wrong with these SQL statements?? Pin
IrishSonic8-Feb-03 6:49
IrishSonic8-Feb-03 6:49 
GeneralDELETE STILL NOT WORKING FOR ME... Pin
IrishSonic8-Feb-03 7:14
IrishSonic8-Feb-03 7:14 
GeneralRe: DELETE STILL NOT WORKING FOR ME... Pin
karl_w8-Feb-03 10:12
karl_w8-Feb-03 10:12 
QuestionWhat database am I using? Pin
David Salter7-Feb-03 11:21
David Salter7-Feb-03 11:21 
AnswerRe: What database am I using? Pin
Bruce Duncan8-Feb-03 0:29
Bruce Duncan8-Feb-03 0:29 
GeneralRe: What database am I using? Pin
David Salter9-Feb-03 7:45
David Salter9-Feb-03 7:45 
GeneralSystem.Data.DataTable write synchronization Pin
Bill Baldasti6-Feb-03 11:41
Bill Baldasti6-Feb-03 11:41 
QuestionDo you access a SQL server the same way as a ACCESS DATABASE?? Pin
IrishSonic5-Feb-03 11:31
IrishSonic5-Feb-03 11:31 
AnswerRe: Do you access a SQL server the same way as a ACCESS DATABASE?? Pin
Philip Patrick7-Feb-03 21:56
professionalPhilip Patrick7-Feb-03 21:56 
GeneralSingle quotes in SQL strings... Pin
Jamie Hale5-Feb-03 0:29
Jamie Hale5-Feb-03 0:29 
GeneralRe: Single quotes in SQL strings... Pin
Richard Deeming5-Feb-03 2:06
mveRichard Deeming5-Feb-03 2:06 
GeneralRe: Single quotes in SQL strings... Pin
Jamie Hale5-Feb-03 3:21
Jamie Hale5-Feb-03 3:21 
GeneralADO.NET -vs- ODBC.NET Pin
ExtraLean4-Feb-03 5:52
ExtraLean4-Feb-03 5:52 

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.