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 544987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:42:49+00:00 2026-05-13T10:42:49+00:00

System.Data.SqlClient.SqlConnection dataConnection = new SqlConnection(); dataConnection.ConnectionString = ConfigurationManager.ConnectionStrings[DBConnectionString].ConnectionString; System.Data.SqlClient.SqlCommand dataCommand = new SqlCommand(); dataCommand.Connection

  • 0
System.Data.SqlClient.SqlConnection dataConnection = new SqlConnection();
dataConnection.ConnectionString = ConfigurationManager.ConnectionStrings["DBConnectionString"].ConnectionString;

System.Data.SqlClient.SqlCommand dataCommand = new SqlCommand();
dataCommand.Connection = dataConnection;

long MachineGroupID = Convert.ToInt64(Request.QueryString["node"]);
dataCommand.CommandText = "UPDATE [MachineGroups] SET [MachineGroupName]=@MachineGroupName,[MachineGroupDesc]=@MachineGroupDesc WHERE [MachineGroupID]= @MachineGroupID";

//add our parameters to our command object  
dataCommand.Parameters.AddWithValue("@MachineGroupName", MachineGroupName);
dataCommand.Parameters.AddWithValue("@MachineGroupDesc", MachineGroupDesc);

dataCommand.Parameters.AddWithValue("@MachineGroupID", MachineGroupID);

dataConnection.Open();
dataCommand.ExecuteNonQuery();
dataConnection.Close();

here the MachineGroups table has a column “tval” which was first inserted with user value and then on updating it should put the default value set by the SQl value when created…

for example

[tval] [int] NOT NULL DEFAULT ((2147483647))

this is how the column was created, and now i want to put the value 2147483647 on updating.

also i cannot fix the value as “2147483647” coz that might change..

any suggestions??

thanks

  • 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-05-13T10:42:50+00:00Added an answer on May 13, 2026 at 10:42 am

    Have you tried to use the DEFAULT keyword? For example:

    UPDATE [MachineGroups] SET [tval] = DEFAULT 
    WHERE [MachineGroupID] = @MachineGroupID
    

    This is supported by the SQL standard, and the syntax docs for UPDATE indicate that Microsoft SQL Server supports this usage of the DEFAULT keyword.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating Windows Application and using System.Data.SqlClient.SqlConnection object SqlConnection targetDatabaseConnection = new SqlConnection(ConnectionString);
System.Data.SqlClient.SqlConnection conec = new System.Data.SqlClient.SqlConnection(data source= + servidor + ; initial catalog= + basedatos
In my installer, I am using System.Data.SqlClient.SqlConnection(connectionstring) to check if I can connect to
I have: DataTable Table = new DataTable; SqlConnection = new System.Data.SqlClient.SqlConnection(Data Source= + ServerName
On Error Resume Next Dim SQLData As New System.Data.SqlClient.SqlConnection(Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True) Dim cmdSelect
using System.Data; using System.Data.SqlClient; I am using a SqlCommand cmd.Parameters of SqlDbType.DateTime to create
I have this class that contains vars for db connection; Imports Microsoft.VisualBasic Imports System.Data.SqlClient
I am getting this error: cannot implicitly convert type 'string' to 'System.Data.SqlClient.Sqlconnection' for this
I found this code on the MSDN site here http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.open.aspx : private static void
I'm receiving a System.Data.SqlClient.SqlException: The server failed to resume the transaction. Desc:6c00000001 when executing

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.