473,405 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Can anyone help me with this stored procedure.

Hi,

Im using stored procedure to update data. but the problem is after click update there is no change.

can anyone check this stored procedure and tell what s the problem.

Expand|Select|Wrap|Line Numbers
  1. CREATE PROCEDURE UpdateTicket
  2.  
  3.     @TicID int = '',
  4.   --  @TicDate datetime = '',
  5.     @TicCreateBy   varchar(50) ='',
  6.     @TicCustomer      varchar(50) ='',
  7.     @TicOwner     varchar(50) ='',
  8.     @TicIssueType varchar(50) ='',
  9.     @TicIssue     varchar(100) ='',
  10.     @TicStatus varchar(50) = '',
  11. --    @TicStatusID varchar(10) = '',
  12.     @TicPriorityID varchar(4) = '',
  13.     @TicPriority varchar(50) ='',
  14.     @TicAction varchar(500)=''
  15.  
  16.  AS
  17.  
  18. UPDATE Ticket
  19.  
  20. SET 
  21.  
  22. --TicDate=@TicDate,
  23. TicCreateBy=@TicCreateBy,
  24. TicCustomer=@TicCustomer,
  25. TicOwner=@TicOwner,
  26. TicIssueType=@TicIssueType,
  27. TicIssue=@TicIssue,
  28. TicStatus=@TicStatus,
  29. --TicStatusID=@TicStatusID,
  30. TicPriorityID=@TicPriorityID,
  31. TicPriority=@TicPriority,
  32. TicAction=@TicAction
  33.  
  34. WHERE TicID=@TicID
  35. GO
thank you.

Meshack
Jul 29 '08 #1
2 1113
r035198x
13,262 8TB
Do you get any error messages?
There could be several reasons why the update may not be happening. You have to provide more details. How are are you calling the stored procedure?
Jul 29 '08 #2
Do you get any error messages?
There could be several reasons why the update may not be happening. You have to provide more details. How are are you calling the stored procedure?
Hi,
Thanks. There is no error showing. But when I click the update button there is no update happens.

Here is the method for calling the stored procedure:
Expand|Select|Wrap|Line Numbers
  1. protected void btnUpdate_Click(object sender, EventArgs e)
  2.     {
  3.         System.Data.SqlClient.SqlConnection conn = new SqlConnection("Data Source=(local);Initial Catalog=DBhelpdesk; Integrated Security=SSPI;");
  4.         conn.Open();
  5.         System.Data.SqlClient.SqlCommand comm = new SqlCommand("UpdateTicket", conn);
  6.         comm.CommandType = CommandType.StoredProcedure;
  7.  
  8.         //string sUserName = Request.Cookies["UserName"].Value;
  9.  
  10.         //comm.Parameters.AddWithValue("@TicDate", Convert.ToDateTime(lbTimeDate.Text));
  11.         comm.Parameters.AddWithValue("@TicCreateBy", tbCreateBy.Text);
  12.         comm.Parameters.AddWithValue("@TicCustomer", tbCustomer.Text);
  13.         comm.Parameters.AddWithValue("@TicOwner", lblOwner.Text);
  14.         comm.Parameters.AddWithValue("@TicIssueType", ddlIssue.Text);
  15.         comm.Parameters.AddWithValue("@TicIssue", tbIssue.Text);
  16.         comm.Parameters.AddWithValue("@TicStatus", ddlStatus.Text);
  17.         comm.Parameters.AddWithValue("@TicPriorityID", lblPriorityID.Text);
  18.         comm.Parameters.AddWithValue("@TicPriority", ddlPriority.Text);
  19.         comm.Parameters.AddWithValue("@TicAction", tbAction.Text);
  20.         comm.ExecuteNonQuery();
  21.         //Response.Write("The Data Have Been Add To Database.");
  22.         //lblRecordV.Text = "The data have been updated to database!";
  23.         conn.Close();
  24.         Response.Redirect("Dashboard2.aspx");
  25.     }
Im doing update in panel. Start from the gridview, when click edit hyperlink field, it will show the update panel.

Here the panel and form code:
Expand|Select|Wrap|Line Numbers
  1. <asp:Panel ID="pnlUpdate" runat="server" Visible="false">
  2.                 <table cellpadding="5" cellspacing="5" class="style37" 
  3.                     style="border: thin solid #EEF2FB; table-layout: fixed;">
  4.                     <tr>
  5.                         <td class="style77" colspan="6">
  6.                             Update</td>
  7.                     </tr>
  8.                     <tr>
  9.                         <td class="style94">
  10.                             Ticket ID :</td>
  11.                         <td class="style88">
  12.                             <asp:Label ID="lblTicID" runat="server"></asp:Label>
  13.                         </td>
  14.                         <td class="style92">
  15.                         </td>
  16.                         <td class="style81">
  17.                         </td>
  18.                         <td class="style56">
  19.                             <span class="style95">Date</span> <span class="style95">:</span></td>
  20.                         <td class="style57">
  21.                             <asp:Label ID="lbTimeDate" runat="server" Font-Bold="False"></asp:Label>
  22.                         </td>
  23.                     </tr>
  24.                     <tr>
  25.                         <td class="style94">
  26.                             C<span>reated By :</span></td>
  27.                         <td class="style88">
  28.                             <b><span class="style93">
  29.                             <asp:TextBox ID="tbCreateBy" runat="server" Height="22px" 
  30.                                 ontextchanged="tbCreateBy_TextChanged" style="font-family: 'Times New Roman'" 
  31.                                 Width="120px"></asp:TextBox>
  32.                             </span></b>&nbsp;</td>
  33.                         <td class="style96">
  34.                             Issue Type :</td>
  35.                         <td class="style81">
  36.                             <b><span class="style93">
  37.                             <asp:DropDownList ID="ddlIssue" runat="server" AutoPostBack="True" 
  38.                                 onselectedindexchanged="DropDownList2_SelectedIndexChanged" 
  39.                                 style="font-family: 'Times New Roman'">
  40.                                 <asp:ListItem></asp:ListItem>
  41.                                 <asp:ListItem Value="Internet">Internet</asp:ListItem>
  42.                                 <asp:ListItem Value="PC Hardware">PC Hardware</asp:ListItem>
  43.                             </asp:DropDownList>
  44.                             </span></b>&nbsp;</td>
  45.                         <td class="style56">
  46.                         </td>
  47.                         <td class="style57">
  48.                             <asp:Label ID="lblPriorityID" runat="server" Font-Bold="False" 
  49.                                 ForeColor="Black" Visible="False"></asp:Label>
  50.                         </td>
  51.                     </tr>
  52.                     <tr>
  53.                         <td class="style91">
  54.                             Customer :</td>
  55.                         <td class="style89">
  56.                             <b><span class="style93">
  57.                             <asp:TextBox ID="tbCustomer" runat="server" 
  58.                                 ontextchanged="tbCustomer_TextChanged" style="font-family: 'Times New Roman'" 
  59.                                 Width="120px"></asp:TextBox>
  60.                             </span></b>&nbsp;</td>
  61.                         <td class="style82">
  62.                             Priority :</td>
  63.                         <td class="style72">
  64.                             <b><span class="style93">
  65.                             <asp:DropDownList ID="ddlPriority" runat="server" 
  66.                                 onselectedindexchanged="DropDownList3_SelectedIndexChanged" 
  67.                                 style="font-family: 'Times New Roman'" Width="103px">
  68.                                 <asp:ListItem></asp:ListItem>
  69.                                 <asp:ListItem Value="Normal">Normal</asp:ListItem>
  70.                                 <asp:ListItem Value="High">High</asp:ListItem>
  71.                                 <asp:ListItem Value="Critical">Critical</asp:ListItem>
  72.                             </asp:DropDownList>
  73.                             </span></b>&nbsp;</td>
  74.                         <td class="style73">
  75.                             Status :</td>
  76.                         <td class="style74">
  77.                             <b><span class="style93">
  78.                             <asp:DropDownList ID="ddlStatus" runat="server" Height="22px" 
  79.                                 onselectedindexchanged="DropDownList1_SelectedIndexChanged" 
  80.                                 style="font-family: 'Times New Roman'" Width="120px">
  81.                                 <asp:ListItem></asp:ListItem>
  82.                                 <asp:ListItem Value="No Action">No Action</asp:ListItem>
  83.                                 <asp:ListItem Value="Pending">Pending</asp:ListItem>
  84.                                 <asp:ListItem Value="Resolved">Resolved</asp:ListItem>
  85.                             </asp:DropDownList>
  86.                             </span></b>&nbsp;</td>
  87.                     </tr>
  88.                     <tr>
  89.                         <td class="style83" colspan="6">
  90.                             <span class="style95">Owner :</span>
  91.                             <asp:Label ID="lblOwner" runat="server" Font-Bold="False"></asp:Label>
  92.                         </td>
  93.                     </tr>
  94.                     <tr>
  95.                         <td class="style97" colspan="6">
  96.                             Issue :</td>
  97.                     </tr>
  98.                     <tr>
  99.                         <td class="style39" colspan="6">
  100.                             <b><span class="style93">
  101.                             <asp:TextBox ID="tbIssue" runat="server" Height="80px" 
  102.                                 ontextchanged="TbIssue_TextChanged" style="font-family: 'Times New Roman'" 
  103.                                 TextMode="MultiLine" Width="433px"></asp:TextBox>
  104.                             </span></b>
  105.                         </td>
  106.                     </tr>
  107.                     <tr>
  108.                         <td class="style85" colspan="6">
  109.                             Action Taken :</td>
  110.                     </tr>
  111.                     <tr>
  112.                         <td class="style39" colspan="6">
  113.                             <asp:TextBox ID="tbAction" runat="server" Height="80px" 
  114.                                 ontextchanged="tbAction_TextChanged" style="font-family: 'Times New Roman'" 
  115.                                 TextMode="MultiLine" Width="433px"></asp:TextBox>
  116.                         </td>
  117.                     </tr>
  118.                     <tr>
  119.                         <td class="style16" colspan="6">
  120.                             &nbsp;&nbsp;&nbsp; &nbsp;<asp:Button ID="btnUpdate" runat="server" onclick="btnUpdate_Click" 
  121.                                 Text="Update" />
  122.                             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="btnCancel" runat="server" onclick="btnCancel_Click" 
  123.                                 Text="Cancel" />
  124.                             &nbsp;&nbsp;</td>
  125.                     </tr>
  126.                 </table>
  127.             </asp:Panel>
Thank you for your help.

Meshack.
Jul 29 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my...
3
by: aaj | last post by:
SQL SERVER 2000 Hi all This is my first attempt at writing a stored procedure. I have managed to get it working but its unlikely to be the best way of handling the problem. While writing it I...
9
by: Ralph Cramden | last post by:
I'm writing a VB6 app which calls several stored procedures on my SQL Server DB. The first stored procedure must complete its inserts before the second stored procedure can query the modified...
7
by: bajwa | last post by:
Hi Our SQL server has a lot of stored procedures and we want to get some cleaning up to be done. We want to delete the ones that have been not run for like 2-3 months. How exactly will i find out...
1
by: Anthony Robinson | last post by:
I'm executing a stored procedure and getting the SQL0440N No authorized routine named "AMROBI2.CREATEAIMCONNECTION" of type "PROCEDURE " having compatible arguments was found. The schema...
4
by: Rhino | last post by:
Is it possible for a Java Stored Procedure in DB2 V7.2 (Windows) to pass a Throwable back to the calling program as an OUT parameter? If yes, what datatype should I use when registering the...
5
by: Andy G | last post by:
I have a registration page that captures 75% of the users data. After they enter that info they are redirected to one of two pages depending on how they answered a question on the registation...
2
by: Crazy Cat | last post by:
Using Visual Basic .NET and SQL Server 2005 I attempt to add a query that is a call to a stored procedure in the DataSet Designer. The TableAdapter Query Configuration wizard finds my stored...
3
by: DR | last post by:
I heard there is some trick to referencing statics in C# CLR stored procedure without having to mark the assembly as unsafe. Does anyone know this? This is usefull as the case of needing a little...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.