|
Try a reinstall. It could help.
|
|
|
|
|
Hi Thanks
for Your suggestion. I have re installed MVC4. It works now.
Thanks for your suggestions.
|
|
|
|
|
|
Below is my stored procedure
ALTER PROCEDURE [dbo].[sp_Workflow]
@TicketID int output,
@StaffID int output,
@Department nvarchar (50),
@FirstName nvarchar (50),
@TicketStatusID int output,
@TicketStatus nvarchar (50),
@TicketPriorityID int output,
@TicketPriority nvarchar (50)
AS
BEGIN
UPDATE dbo.Staff
SET
FirstName = @FirstName,
Department = @Department
WHERE StaffID= @StaffID
UPDATE dbo.TicketStatus
SET
TicketStatus = @TicketStatus
WHERE TicketStatusID =@TicketStatusID
UPDATE dbo.TicketPriority
SET
TicketPriority = @TicketPriority
WHERE TicketPriorityID =@TicketPriorityID
END
T his is my code
private void Updatebutton_Click(object sender, EventArgs e)
{
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd = new SqlCommand("sp_Workflow", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@TicketID", System.Data.SqlDbType.Int).Value = TicketIDcomboBox.ToString();
cmd.Parameters.Add("@Department", System.Data.SqlDbType.NVarChar, 50).Value = MoveToDepartmentcomboBox.SelectedValue.ToString();
cmd.Parameters.Add("@FirstName", System.Data.SqlDbType.NVarChar, 50).Value = StaffcomboBox.SelectedValue.ToString();
cmd.Parameters.Add("@TicketStatus", System.Data.SqlDbType.NVarChar, 50).Value = ChangeTicketStatuscomboBox.SelectedValue.ToString();
cmd.Parameters.Add("@TicketPriorty", System.Data.SqlDbType.NVarChar, 50).Value = ChangeTicketPrioritycomboBox.SelectedValue.ToString();
MessageBox.Show("Are you sure you want to update?");
cmd.ExecuteNonQuery();
MessageBox.Show("Ticket Updated");
con.Close();
}
}
|
|
|
|
|
The trick to solving an issue like this is to put a breakpoint in the start of your code and step through it, inspecting the values of various variables to see what they contain. For instance, looking at your code, it strikes me that the problem might possibly be with the line con.Open(); . What if con is null? Where are you allocating it? BTW - you are showing a messagebox and then doing nothing with the result to prevent the query being executed. If I were you, I would move this to the top of the method and only proceed if the user clicks Yes.
|
|
|
|
|
The first step is to figure out where the null reference error is happening.
Why not put a break-point at the entry to the Updatebutton_Click EventHandler code, and single-step through the code until you find the error.
If you call the 'ToString method on a ComboBox's SelectedValue when there is no value selected, you will get a null reference error: that's one of the possible sources of error to evaluate.
"What Turing gave us for the first time (and without Turing you just couldn't do any of this) is he gave us a way of thinking about and taking seriously and thinking in a disciplined way about phenomena that have, as I like to say, trillions of moving parts.
Until the late 20th century, nobody knew how to take seriously a machine with a trillion moving parts. It's just mind-boggling." Daniel C. Dennett
|
|
|
|
|
Try debugging your code when this type of error occurs. This generally happens when you access a property or method of an object that itself is null.
|
|
|
|
|
How can i detect an xbee if its connected to computer or not via USB ? and get notification if its connected or not
|
|
|
|
|
I usually first listen to the sound of the computer and verify there is a humming.
Then I place a tea-spoonful of honey in an open dish near the computer and listen to see if there is a change in the pitch of the humming.
If that doesn't work, I use Google to locate two CodeProject articles in the top three search results returned by: [^], and start writing code while trying not to think of dead bees.
good luck, Bill
"What Turing gave us for the first time (and without Turing you just couldn't do any of this) is he gave us a way of thinking about and taking seriously and thinking in a disciplined way about phenomena that have, as I like to say, trillions of moving parts.
Until the late 20th century, nobody knew how to take seriously a machine with a trillion moving parts. It's just mind-boggling." Daniel C. Dennett
|
|
|
|
|
BillWoodruff wrote: start writing code while trying not to think of dead bees For the pure Monty Python that put in my mind, I award you the Order of Pete - it's a shiny badge of honour that you should wear with pride. To get your copy, simply print our your reputation page and look for the points that corresponds to the 5 and cut it out. Wear it with pride my friend.
|
|
|
|
|
|
|
Hello All,
On my project I want to change file and folder default icon same as dropbox. I have already made some Google and get a solution using vc++ but I don't have any experience on vc++ for that reason I am not able to apply this on my project.
So my request to you please suggest me, how can I do the same using C# ? I am familiar on C# language.
Please share with me me your valuable experience on this point. I am waiting for your valuable reply.
Thanks in advanced,
Tapas
|
|
|
|
|
If you added C# to your Google search terms, or had done the search inside CP itself, you might have ended up here[^]. Make sure to read the comments as well.
|
|
|
|
|
You beat me by seconds.
Veni, vidi, abiit domum
|
|
|
|
|
|
Thanks Richard for your valuable response.
I have already applied it and it working fine for folder icon change. But it not working for file icon change.
So please suggest me for file icon change.
Thanks once again,
Tapas
|
|
|
|
|
|
Thanks Richard once again,
Its not same that I am expecting. Actually I am trying to find a file icon overlay same as Dropbox/Tortorise SVN working folder.
Please give me some alternate solution.
Thanks,
Tapas
|
|
|
|
|
Tapas Saha wrote: I am trying to find Then Google is the tool of choice.
Veni, vidi, abiit domum
|
|
|
|
|
Why? Microsoft is actively discouraging the use of icon overlays.
|
|
|
|
|
Well, "...I want to change file and folder default icon same as dropbox..." what it means?
What is your dropbox? There is no answer if you suggest your problem clearly.
|
|
|
|
|
Hello WuRunZhe,
Thanks for your reply.
Actually on dropbox after sync new file and folder a green trick mark added on file and folder icon. I want something like that.
Please suggest...
|
|
|
|
|
I have 2 forms --> Form1 and Form2
Both contain a textbox(textbox1).
Form2 have a button. When I click on that button i want to take the text from Form2.textbox and paste it into Form1.textbox.
How to do that?
Thanks.
|
|
|
|
|
You have not done even the minimum research on this one. Have some Google Foo[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|