Click here to Skip to main content
15,909,897 members
Home / Discussions / C#
   

C#

 
GeneralRe: How To Convert Forms To User Control Pin
Dave Kreskowiak18-Aug-05 5:00
mveDave Kreskowiak18-Aug-05 5:00 
GeneralRe: How To Convert Forms To User Control Pin
moh_monir18-Aug-05 19:31
moh_monir18-Aug-05 19:31 
GeneralRe: How To Convert Forms To User Control Pin
Dave Kreskowiak19-Aug-05 1:36
mveDave Kreskowiak19-Aug-05 1:36 
Generalserial port Pin
Member 208806918-Aug-05 0:32
Member 208806918-Aug-05 0:32 
GeneralRe: serial port Pin
Dave Kreskowiak18-Aug-05 4:54
mveDave Kreskowiak18-Aug-05 4:54 
GeneralImplementing Layouts Pin
ivix4u18-Aug-05 0:31
ivix4u18-Aug-05 0:31 
GeneralRe: Implementing Layouts Pin
Mohamad Al Husseiny18-Aug-05 1:52
Mohamad Al Husseiny18-Aug-05 1:52 
GeneralUpdating and Inserting From DataGrid To MS SQL Pin
sonicsqwirl18-Aug-05 0:23
sonicsqwirl18-Aug-05 0:23 
This is the INSERT command i call to try and insert a new record into the MS SQL Table. There is another value "t_id" used for the ID, but it is set to auto increment in the database.

When i run this code i get this error:

Line 1: Incorrect syntax near '?'. <br />
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <br />
<br />
Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near '?'.<br />
<br />
Source Error: <br />
<br />
<br />
Line 178:				<br />
Line 179:				insCon.Open();<br />
Line 180:				insCmd.ExecuteNonQuery();<br />
Line 181:				insCon.Close();<br />
Line 182:				<br />



public void AddTicket_Click(Object Src, EventArgs E){												<br />
				<br />
				string insSql = "INSERT INTO MCI_Tickets (t_date, t_num, t_circuitID, t_ter, t_sc, t_cu, t_loc, t_info) Values (?, ?, ?, ?, ?, ?, ?, ?)";<br />
				SqlConnection insCon = new SqlConnection(Conn);<br />
				SqlCommand insCmd = new SqlCommand(insSql, insCon);<br />
				<br />
				insCmd.Parameters.Add(new SqlParameter("@t_date", SqlDbType.DateTime, 8));<br />
				insCmd.Parameters["@t_date"].Value = tDate.Text;<br />
				insCmd.Parameters.Add(new SqlParameter("@t_num", SqlDbType.Char, 5));<br />
				insCmd.Parameters["@t_num"].Value = tNum.Text;<br />
				insCmd.Parameters.Add(new SqlParameter("@t_circuitID", SqlDbType.Char, 15));<br />
				insCmd.Parameters["@t_circuitID"].Value = tCir.Text;<br />
				insCmd.Parameters.Add(new SqlParameter("@t_ter", SqlDbType.Char, 5));<br />
				insCmd.Parameters["@t_ter"].Value = tTer.SelectedValue;<br />
				insCmd.Parameters.Add(new SqlParameter("@t_sc", SqlDbType.Char, 6));<br />
				insCmd.Parameters["@t_sc"].Value = tSc.SelectedValue;<br />
				insCmd.Parameters.Add(new SqlParameter("@t_cu", SqlDbType.Char, 6));<br />
				insCmd.Parameters["@t_cu"].Value = tCu.SelectedValue;<br />
				insCmd.Parameters.Add(new SqlParameter("@t_loc", SqlDbType.NVarChar, 50));<br />
				insCmd.Parameters["@t_loc"].Value = tLoc.SelectedValue;<br />
				insCmd.Parameters.Add(new SqlParameter("@t_info", SqlDbType.NVarChar, 50));<br />
				insCmd.Parameters["@t_info"].Value = tInfo.Text;<br />
				<br />
				insCon.Open();<br />
				insCmd.ExecuteNonQuery();<br />
				insCon.Close();<br />
				<br />
				DoConnect();<br />
				pnlAdd.Visible = false;<br />
			}


Thanks, Any help would be appreciated
GeneralScrollbars in UserControl Pin
bouli18-Aug-05 0:02
bouli18-Aug-05 0:02 
GeneralRe: Scrollbars in UserControl Pin
Mohamad Al Husseiny18-Aug-05 1:47
Mohamad Al Husseiny18-Aug-05 1:47 
GeneralcharAt help Pin
binglin17-Aug-05 23:22
binglin17-Aug-05 23:22 
GeneralRe: charAt help Pin
lmoelleb18-Aug-05 0:20
lmoelleb18-Aug-05 0:20 
GeneralRe: charAt help Pin
binglin18-Aug-05 17:28
binglin18-Aug-05 17:28 
GeneralRe: charAt help Pin
lmoelleb18-Aug-05 20:19
lmoelleb18-Aug-05 20:19 
GeneralRe: charAt help Pin
mav.northwind20-Aug-05 9:27
mav.northwind20-Aug-05 9:27 
QuestionA better way to do this? Pin
John Nobody17-Aug-05 22:57
John Nobody17-Aug-05 22:57 
AnswerRe: A better way to do this? Pin
leppie17-Aug-05 23:33
leppie17-Aug-05 23:33 
GeneralRe: A better way to do this? Pin
Anonymous17-Aug-05 23:58
Anonymous17-Aug-05 23:58 
GeneralRe: A better way to do this? Pin
leppie18-Aug-05 0:07
leppie18-Aug-05 0:07 
GeneralNeed help with threading Pin
Yannielsen17-Aug-05 22:56
Yannielsen17-Aug-05 22:56 
GeneralRe: Need help with threading Pin
Sean Michael Murphy18-Aug-05 3:45
Sean Michael Murphy18-Aug-05 3:45 
QuestionHow to identify .NET dll from others (such as COM dll) Pin
Member 220452217-Aug-05 22:42
Member 220452217-Aug-05 22:42 
AnswerRe: How to identify .NET dll from others (such as COM dll) Pin
Anonymous17-Aug-05 23:06
Anonymous17-Aug-05 23:06 
GeneralRe: How to identify .NET dll from others (such as COM dll) Pin
Member 220452217-Aug-05 23:24
Member 220452217-Aug-05 23:24 
GeneralRe: How to identify .NET dll from others (such as COM dll) Pin
Daniel Grunwald18-Aug-05 3:27
Daniel Grunwald18-Aug-05 3:27 

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.