I have the code as below. I am trying to simply get data from a table i have already created. How do i get the data in the array p_fields that is defined in the callback function into a variable in …
Tag: c#
C# SqlReader issue
I’am posting on this forum for the first time . and I really hope I can find some help . What I’am doing is load about … 1000 Value (example) from SQL and I’am doing it just fine . the query for example is : Select Value from DatabaseA.dbo.Values that “Value” ==> decimal(10, 2) this propably should work fine .
Command.ExecuteScalar always return null while Stored Procedure in Management Studio runs fine
I have the following SQL stored procedure with one input parameter and one out parameter. CREATE PROCEDURE [dbo].[spCanUserEdit] ( @username nvarchar(255) ) AS BEGIN SET NOCOUNT ON; DECLARE @CanEdit …
Membership stored procedure aspnet_Membership_CreateUser not working
I have been trying to make the build in stored procedure to work with Register.aspx. I’m not using the wizard part. Hence writing my own code. I don’t understand where the error is. If I use exec stored procedure and send the same value it will execute in Management Studio. But in code it fails. Here is the code that
Sql Command Not Working
I wrote the following code, but nothing is being inserted into the database. I tried changing the SA password in the connection string to something incorrect and the code isn’t catching the exception. What am I doing wrong? Answer As stated by the OP in the comments. Once the try-catch was resolved it was discovered that it just a mismatched
Stored procedure returns int instead of result set
I have a stored procedure that contains dynamic select. Something like this: In SSMS the stored procedure runs fine and shows result set. In C# using Entity Framework it shows returning an int instead of IEnumerable? Generated function for usp_GetTestRecords Answer Entity Framework can’t tell what your stored procedure is returning. I’ve had success creating a table variable that mirrors
SqlCommand INSERT INTO query does not execute
Hello guys I have got this code: It should insert data from textboxes: kname, ksurname, but it closes the form without showing them in MS SQL table klient Answer Missing the ExecuteNonQuery call A command should be executed to update the database…
update data with connected ado.net layer
I’m trying to perform update operation on winform using connected ado.net layer. here’s the code using this query I’m getting exception $exception {“Dynamic SQL ErrorrnSQL error code = -104rnToken unknown – line 1, column 15rn(“} System.Exception {FirebirdSql.Data.FirebirdClient.FbException} Answer Should not query be like this:
LINQ to SQL, select from an inheritted class
Using LINQ to SQL and Object Relational Designing; Let’s say we have a class Animal with two inherited classes, named Cat and Dog. We can load the “Animal” class and its properties easily: However, when trying to load Cat or Dog, dataContext has the attribute of neither Cats nor Dogs. How is it possible to load a Cat or a
Calling SQL Defined function in C#
I have written this scalar function in TSQL: create function TCupom (@cupom int) returns float as begin declare @Tcu float; select @Tcu = sum (total) from alteraca2 where pedido = @cupom …