Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
1k views

I have a database with 3 tables Identification, Identification_group and Group. The Identification_group table has 2 foreign key columns, Identificaiton_id and Group_id. In my form you can ...
mwern's user avatar
  • 1
1 vote
1 answer
150 views

Is there a way to get the Reader object from SqlCommand.ExecuteReader without failing on SqlException? In SSMS, for this command: RAISERROR (15600, 12, 5, 'example'); SELECT * FROM TableName I got ...
mordechai's user avatar
  • 851
0 votes
1 answer
326 views

I have a simple table : CREATE TABLE [MyTable] ( [ID] [INT] IDENTITY(1,1) NOT NULL, [NAME] [NVARCHAR](100) NOT NULL, [DATA] [NVARCHAR](max) NOT NULL, CONSTRAINT [PK_MyTable] ...
BaltoStar's user avatar
  • 9,151
3 votes
1 answer
10k views

I've seen the different discussions of using Parameters.Add vs Parameters.AddWithValue (one is explicit, the other is not), but that isn't my issue. I'm defining a command, which will be used to do ...
SchmitzIT's user avatar
  • 9,749
0 votes
4 answers
271 views

public class Person { public int PersonId { get; set; } public string SurName { get; set; } public string LastName { get; set; } public DateTime DateOfBirth { get; set; } ...
Kylian Nijdam's user avatar
0 votes
1 answer
87 views

ASP.Net Core I have the code than calls var resp = await conn.ExecuteAsync("procedureName", sqlParams, commandType: CommandType.StoredProcedure).ConfigureAwait(false) When I start my application on ...
Anton Koposov's user avatar
0 votes
2 answers
2k views

This is how I set up my command. It stops with the first parameter, UpdateType. This code is being updated from VB.NET 2008 version. Dim db As New DB() Dim cmd As SqlCommand = New SqlCommand() 'Put ...
jamesT's user avatar
  • 111
-1 votes
2 answers
75 views

I need help on this line string query = @"IF EXISTS(Select * From u_Data Where TAG = '" + txtTag.Text + "') begin Update u_data set Name = '" + txtNama.Text + "', NIK = '" + txtNIK....
Hermada Deva's user avatar
-2 votes
1 answer
491 views

I have two tables and data like below: I want to compare two table's columns "Type and MatchType" and identify the Ids of first table where Type is missing in MatchType. "Type" and "MatchType" are ...
Jasmine's user avatar
  • 5,317
-1 votes
1 answer
1k views

I'm using C# with .NET SqlDataReader(), SqlConnection(), SqlCommand() and .ExecuteReader() classes. In vbScript, I can open RecordSets like this: rs.open cSQL, cn, adOpenForwardonly, adLockReadonly ...
KWallace's user avatar
  • 632
0 votes
0 answers
169 views

I am trying to get this method to read values from the database as well as to get values from an asp.net webform. I have tried the code below but never worked public void CheckLikedEvents() ...
Mina Bebawi's user avatar
-2 votes
2 answers
96 views

I want to insert my DataGridView datas to my database i used parametrs these are my database fileds CREATE TABLE [dbo].[Tbl_Order] ( [Name] VARCHAR (50) NULL, [Price] INT ...
Mhamad Commander's user avatar
-1 votes
2 answers
86 views

i am creating a simple crud in c#.net.after add the record record will show on the datagridview itself. but i couldn't do it. code which tried so far i attched below. code sql = "insert into student(...
jaya priya's user avatar
0 votes
1 answer
2k views

I have a product record table in the database, it will save the following: ID, product code, product name, size, and price. A product can have the same size and price right? In my code, I am trying to ...
yoonsanha's user avatar
0 votes
1 answer
155 views

I've got a Log method: public void Log(string log) { command = new SqlCommand() { Connection = connection }; command.CommandText = "INSERT INTO Logs (Date, Login, Transact) " + $"VALUES ('...
Markomar's user avatar
  • 163
-2 votes
1 answer
2k views

This is the table named employee. This is the question and sample output SELECT MONTH(EMP_HIREDDATE) AS “Hire Month”, COUNT(EMP_NUM) AS “No Of Employee” FROM EMPLOYEE GROUP BY EMP_NUM; The above ...
zZzZ's user avatar
  • 173
0 votes
2 answers
107 views

I'm using gcloud mysql and inserting values and stuff using c#. Im trying to get amount of records in table Categories_tbl. My code is: but after executing x is equal to -1 which wrong. what could it ...
riki's user avatar
  • 186
1 vote
1 answer
372 views

In the following code, I'm trying to retrieve the ID of the manager which then has to be passed as the second parameter to the SQL Stored procedure as shown in the code below: Currently the code uses ...
Karu3103's user avatar
0 votes
0 answers
373 views

the problem that I have is 'Conversion failed when converting the varchar value '@param4' to data type int.' I'm new to databases and don't know how to nest SQL injections(I hope i'm using the term ...
Claudiu  Filip's user avatar
0 votes
2 answers
936 views

Building a tool to backup a database that I'm testing locally first. I'm trying to check if compression is supported and change my SQL query based on the value returned. Running it against an actual ...
Red Rabbit's user avatar
-1 votes
2 answers
73 views

I am trying to execute a SQL stored procedure and collect the results in a List<T>. I do not get errors, but the list is always null. The stored procedure produces over 100 records so I know ...
Rani Radcliff's user avatar
2 votes
0 answers
763 views

I want to save the complete result of a FOR XML SQL Query to a file. My SQL Query looks something like this: SELECT * FROM Customer FOR XML RAW in my code, I now want to execute this query against ...
dczychon's user avatar
0 votes
0 answers
84 views

I am using a SQL Server database in my C# project. Currently I give my SQL query parameters via the AddWithValue function without the explicit specification of inverted commas. Can I be sure that ...
MavidDeyers's user avatar
0 votes
1 answer
575 views

Currently I am using SqlCommands to run stored procedures, I will ExecuteReader and run a while .read, assigning each field to an object then adding that object to a list. This has worked fine so far ...
G_Man's user avatar
  • 1,343
0 votes
1 answer
220 views

With a button press I'm trying to update the GridView on my ASP.net site with Database from SQL server with other table but it doesnt change, there is no "catch". The GridView doesn't appear. { ...
ExtraSun's user avatar
  • 558
2 votes
0 answers
88 views

I'm working on library which allows me to create connections, commands, readers etc for 3 db types: oracle, postgresql and sql server. I need to pass parameters into query but it seems like postgres ...
Adam Mrozek's user avatar
  • 1,510
0 votes
1 answer
328 views

i want to write query which is written using linq and data dictionary i want to convert that query in ado.net form var insData = new Dictionary<string, string>(); insData =...
shreyas35's user avatar
  • 175
0 votes
1 answer
410 views

I run a C# app, which gets json from MS SQL 2016 using a stored procedure. string t = da.ExecuteScalar().ToString(); I get strangely formatted json: "{\"Komponent\":\"00066X96A\",\"Opis\":\"Part2 II ...
user3768730's user avatar
0 votes
1 answer
348 views

I have some problem with this code, the return variable I want is "Sơn" instead of 'S' My code: SentoDB.RunProcedure("usp_GetNameWithIdCategory"); SqlParameter CategoryID = new SqlParameter("...
Khanh Duy's user avatar
2 votes
3 answers
147 views

I can't extract the values through a query and insert them into textboxes Where am I going wrong? Request.QueryString.Get("ID_Persona"); string query = "SELECT ID,Nome,Cognome,Email,CodiceFiscale ...
pixel789's user avatar
  • 128
0 votes
1 answer
463 views

I use SQL Server 2012. In this stored procedure, I want to get the value of @@identity or SELECT SCOPE_IDENTITY(). intMyIdentity is the identity column. CREATE PROCEDURE [spMyInsert] (@vchVar AS ...
faujong's user avatar
  • 1,179
0 votes
1 answer
46 views

I am getting the following error in my code: "There is already an open DataReader associated with this Command which must be closed first." I have two SqlDataReaders and I made sure that I closed ...
Dizzy49's user avatar
  • 1,550
0 votes
1 answer
338 views

I am trying to populate parent objects with child object that match but cannot figure out how to only display the ones that match. I manage to get the child objects and add them to the list but it ...
User1234's user avatar
0 votes
1 answer
533 views

I am using the below select statement to pick up data from excel and drop it into a datatable. There is a bad row in there that I do not want to pick up so thats this part [Plan] <> 'PLAN_BO' ...
user10471443's user avatar
0 votes
0 answers
392 views

I have written code using SqlDependency. In using select statement with list of columns, OnChangeEventHandler event is fired but when I change select statement to get count of rows, ...
CodesDDecodes's user avatar
0 votes
1 answer
1k views

I am trying to create stored procedures with different schemas using SQL Command Variables, however I cannot build the project due to the error: SQL71501: Procedure: [$(SchemaName)].[pr_MySproc] has ...
Dryden Long's user avatar
  • 10.2k
0 votes
0 answers
82 views

I have two database tables that are many-to-many tblBook idBook Title Writer ect... tblBookGenre id idBook idGenre tblGenre idGenre NameGenre And tblBook idBook Title Writer ect... tblBookTag ...
User1234's user avatar
4 votes
1 answer
2k views

I noticed some odd behavior and hoped one of the experts could explain the difference. My UI requires an image is unique before presenting it to the user for their task. I store checksums in the ...
JoeBob_OH's user avatar
  • 437
0 votes
1 answer
199 views

Is it possible to select data rows from local database when those rows are not present in remote database? I wrote a code, but it doesn't work: conlocal is the local database connection, and conremote ...
DIPANKAR's user avatar
-3 votes
2 answers
527 views

this is my code in the dataset.cs. what do I have to add for set the timeout in the connection and the command? namespace M_Report { partial class A_DBDataSet { partial class ...
user avatar
0 votes
1 answer
3k views

I am trying to query the table to look for record like this: string owner = "sometextlikethis"; string pictureName = "pexels-photo.jpg_15-Apr-19 07:59:37"; //problem PictureLibrary _pictureObj = new ...
positive perspective's user avatar
3 votes
0 answers
103 views

I have a custom application that builds a Lucene Index on our various SQL Server VMs hosted in Azure (it runs locally on the machine. I know this isn't ideal, but reasons). This program has run ...
Rich's user avatar
  • 39
0 votes
1 answer
102 views

I am trying to get total count of records in "@TotalRecordsCount" which will be returned after applying all my search parameters. but it is always giving me null value. i tried other matching options ...
Waqas Nadeem's user avatar
0 votes
1 answer
1k views

I want to know is it possible to run MS SQL Server index rebuild or reorganize operations from c# winform? I have a script using rebuild and reorganize. Now I want to run the whole script on the ...
igelr's user avatar
  • 1,821
-1 votes
2 answers
103 views

I want to share the SQL table column. The first column will contain data upto 1-10, 11-20 in the second column and 21-30 in the 3rd column in the form of data.
Md. Altaf Hossain's user avatar
-1 votes
1 answer
45 views

I am trying to get the current userid from the parameter and to check if it exists in a Database Table using stored procedure public PartialViewResult AllStates(string state, string userid) { ...
Favour Emmanuel's user avatar
1 vote
2 answers
380 views

I have this method, which I have in the base class that helps me to select anything from the children classes and also to reduce code repetition. The problem is when I call it I get an error which is ...
user3560798's user avatar
3 votes
2 answers
1k views

I have a requirement where I need to know when the sum(value) reaches certain point and calculate duration. Below is the sample table. create table sample (dt timestamp, value real); insert into ...
acul's user avatar
  • 59
1 vote
1 answer
57 views

I have an SQL query and it has comma value. When I adding it to DataGridView I want to this format (#, ##). I tried Math.Round() function but it doesn't work. Below is the query I have tried: (...
hellocoderfriends's user avatar
0 votes
2 answers
2k views

I want to normalization operation in my code. I have a SQL - Server table, it has 3 columns; first column has single words, second column has single words, third column has integer values. I ...
ImaNewCoder's user avatar

1 2
3
4 5
19