Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8268453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:53:38+00:00 2026-06-08T05:53:38+00:00

ALTER PROCEDURE InsertHash @FileName varchar(max), @Hash varchar(max) AS UPDATE tabletest SET deneme1 = @Hash,

  • 0
ALTER PROCEDURE InsertHash
    @FileName varchar(max),
    @Hash  varchar(max)
AS
UPDATE tabletest 
SET deneme1 = @Hash, deneme2 =@FileName

this is my stored procedure, and i send some data

while (rdr.Read())
{
    string filename = @"\\" + rdr.GetString(3);
    filename = System.IO.Path.Combine(filename, rdr.GetString(2));
    filename = System.IO.Path.Combine(filename, rdr.GetString(1));
    computeHashh1 abc = new computeHashh1();
    Console.WriteLine(abc.computeHash(filename));
    SqlCommand myCommand2 = new SqlCommand("InsertHash", myConnection);
    myCommand2.CommandType = CommandType.StoredProcedure;
    SqlParameter param = new SqlParameter("@FileName", filename);
    myCommand2.Parameters.Add(param);
    SqlParameter param2 = new SqlParameter("@Hash", abc.computeHash(filename));
    myCommand2.Parameters.Add(param2);
}

its not updating the table when i run the code, what can be the problem, sory for such bad question im quite new to sql

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:53:41+00:00Added an answer on June 8, 2026 at 5:53 am

    The one thing you don’t with with myCommand2 is… execute it:

    myCommand2.ExecuteNonQuery();
    

    well, actually you should dispose it too…

    while (rdr.Read())
    {
        // ... blah
        using(var myCommand2 = new SqlCommand("InsertHash", myConnection))
        {
            // setup parameters etc
            myCommand2.ExecuteNonQuery();
        }
    }
    

    Or if that seems too much work… some “dapper” love:

    myConnection.Execute("InsertHash", new {
            FileName = filename,
            Hash = abc.computeHash(filename)
        }, commandType: CommandType.StoredProcedure);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this stored Proc: ALTER Procedure [dbo].[GetWebinars] ( @GroupingCode varchar(max) = 'AVM', @ItemNumber
I have this stored procedure for validating login ALTER PROCEDURE ValidateUserLogin ( @UserName varchar
--Stored procedure ALTER PROCEDURE [dbo].[Test] @USERID varchar(25) AS BEGIN SET NOCOUNT ON IF NOT
WhenI call this stored procedure: ALTER PROCEDURE [dbo].[GetSorted] ( @OrderByColumn nvarchar(256) ) AS SET
I have the following procedure: ALTER PROCEDURE [dbo].[UpdateAllClients] @ClientIDs varchar(max) AS BEGIN SET NOCOUNT
ALTER PROCEDURE [dbo].[AmendInsertDuplicateFields] (@ReportID varchar(50)) AS BEGIN DECLARE @NewReportID VARCHAR(50) SET @NewReportID = NEWID()
If I have this stored proc definition minus the body ALTER PROCEDURE sp_AlloctionReport(@where NVARCHAR(1000),
I have this stored procedure in my database: ALTER PROCEDURE [dbo].[sp_FTSearchLocation] @SearchFor nvarchar(200) =
I have this stored Procedure in MS SQL2008 (C#) ALTER PROCEDURE UpdateProducts @ProductID INT,
This is my stored procedure: ALTER PROCEDURE its.sp_WriteTransaction ( @LoginID int, @PersonID int, @BusinessID

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.