Click here to Skip to main content
14,975,553 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionAdding row to the gridview Pin
kimo code11-Jul-08 20:07
Memberkimo code11-Jul-08 20:07 
QuestionHTML control Pin
strawberrysh11-Jul-08 18:49
Memberstrawberrysh11-Jul-08 18:49 
AnswerRe: HTML control Pin
Imran Khan Pathan11-Jul-08 19:16
MemberImran Khan Pathan11-Jul-08 19:16 
QuestionHow to merge corresponding cells of Table control Pin
Rameez Raja11-Jul-08 18:31
MemberRameez Raja11-Jul-08 18:31 
AnswerRe: How to merge corresponding cells of Table control Pin
Imran Khan Pathan11-Jul-08 19:04
MemberImran Khan Pathan11-Jul-08 19:04 
QuestionProblem with IIS when some one Authenticates Pin
maryam.saboor11-Jul-08 18:24
professionalmaryam.saboor11-Jul-08 18:24 
Questionsuggestion is needed Pin
Rameez Raja11-Jul-08 18:11
MemberRameez Raja11-Jul-08 18:11 
QuestionCannot figure this one out.... SQL datasource & c# Pin
Jacob Dixon11-Jul-08 15:20
MemberJacob Dixon11-Jul-08 15:20 
Ok here is my code:

string[] info = new string[2];
info[0] = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString();
info[1] = "OPEN";

SqlDataSource sds = new SqlDataSource(ConfigurationManager.ConnectionStrings["HelpDeskConnectionString"].ConnectionString, "Select ID From [Company_Ticket]");
sds.ID = "SqlDataSource1";
this.Controls.Add(sds);

TextBox txt = new TextBox();
txt.ID = "txtTime";
txt.Text = info[0];
txt.Visible = false;
this.Controls.Add(txt);

txt.ID = "txtStatus";
txt.Text = info[1];
txt.Visible = false;
this.Controls.Add(txt);

QueryStringParameter qsp = new QueryStringParameter();
qsp.Name = "AdminName";
qsp.QueryStringField = "Admin";
qsp.Type = TypeCode.String;

ControlParameter cp = new ControlParameter();
cp.ControlID = "TextBox2";
cp.Name = "Issue";
cp.Type = TypeCode.String;
sds.InsertParameters.Add(cp);

cp.ControlID = "TextBox1";
cp.Name = "Company";
cp.Type = TypeCode.String;
sds.InsertParameters.Add(cp);

cp.ControlID = "txtTime";
cp.Name = "Started";
cp.Type = TypeCode.DateTime;
sds.InsertParameters.Add(cp);

cp.ControlID = "txtStatus";
cp.Name = "TheStatus";
cp.Type = TypeCode.String;
sds.InsertParameters.Add(cp);

sds.InsertCommand = "INSERT INTO [Company_Ticket] (Admin, Started, Issue, Company, Status) VALUES (@AdminName, @Started, @Issue, @Company, @TheStatus)";
sds.Insert();



Ok here is the error I get:

The variable name '@TheStatus' has already been declared. Variable names must be unique within a query batch or stored procedure.
Must declare the scalar variable "@AdminName".


I don't get it.. I declare TheStatus only once.. and why do I keep getting this about AdminName?
AnswerRe: Cannot figure this one out.... SQL datasource & c# Pin
Mike Ellison11-Jul-08 15:31
MemberMike Ellison11-Jul-08 15:31 
GeneralRe: Cannot figure this one out.... SQL datasource & c# Pin
Jacob Dixon12-Jul-08 4:31
MemberJacob Dixon12-Jul-08 4:31 
Questionhow to close/hide the popup onmouseout event Pin
For_IT11-Jul-08 15:06
MemberFor_IT11-Jul-08 15:06 
QuestionControlling page elements from a .config file Pin
Cyberpulse11-Jul-08 14:10
MemberCyberpulse11-Jul-08 14:10 
AnswerRe: Controlling page elements from a .config file Pin
Mike Ellison11-Jul-08 15:36
MemberMike Ellison11-Jul-08 15:36 
QuestionCustom control for FormView? Pin
equalizer70011-Jul-08 8:49
Memberequalizer70011-Jul-08 8:49 
AnswerRe: Custom control for FormView? Pin
Paul Conrad11-Jul-08 9:59
professionalPaul Conrad11-Jul-08 9:59 
QuestionHelp - >SQLException Pin
AprNgp11-Jul-08 8:19
MemberAprNgp11-Jul-08 8:19 
AnswerRe: Help - >SQLException Pin
ToddHileHoffer11-Jul-08 9:27
MemberToddHileHoffer11-Jul-08 9:27 
QuestionGetting information from datalist Pin
Jacob Dixon11-Jul-08 7:14
MemberJacob Dixon11-Jul-08 7:14 
AnswerRe: Getting information from datalist Pin
Parwej Ahamad11-Jul-08 7:26
professionalParwej Ahamad11-Jul-08 7:26 
AnswerRe: Getting information from datalist Pin
Sherin Iranimose11-Jul-08 7:35
MemberSherin Iranimose11-Jul-08 7:35 
GeneralRe: Getting information from datalist Pin
Jacob Dixon11-Jul-08 9:46
MemberJacob Dixon11-Jul-08 9:46 
AnswerRe: Getting information from datalist Pin
Sneha Bisht11-Jul-08 21:31
MemberSneha Bisht11-Jul-08 21:31 
QuestionRegular expression for valid time format (hr:min:sec) entered by user in text box Pin
For_IT11-Jul-08 6:51
MemberFor_IT11-Jul-08 6:51 
AnswerRe: Regular expression for valid time format (hr:min:sec) entered by user in text box Pin
Paul Conrad11-Jul-08 10:00
professionalPaul Conrad11-Jul-08 10:00 
GeneralRe: Regular expression for valid time format (hr:min:sec) entered by user in text box Pin
For_IT11-Jul-08 14:54
MemberFor_IT11-Jul-08 14:54 

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.