15,925,369 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by praveenmachat (Top 9 by date)
praveenmachat
12-Jul-14 0:00am
View
Yes ,Thanks.
Can you please guide me for http://www.codeproject.com/Questions/795817/How-do-retrieve-data-table-from-stored-procedure
praveenmachat
11-Jul-14 14:27pm
View
For all this cases, if apostrophe is there in where condition.
I could not retrieve values properly.
kindly advise
praveenmachat
11-Jul-14 12:40pm
View
sorry,
my knowledge is limited ,
Can I have a sample code
or you mean to say use code like below
DataTable dt = new DataTable();
ADPTR = new SqlDataAdapter("exec procedureName", "connection string");
ADPTR.Fill(dt );
Thanks,
Praveen
praveenmachat
11-Jul-14 11:59am
View
Sorry,
it was before getting answer,
I though it will simplify my question.
now I am trying to delete this one
Thanks,
Praveen
praveenmachat
11-Jul-14 11:49am
View
Thank you very much....
Praveen
praveenmachat
11-Jul-14 11:35am
View
i am just beginner ,my knowledge is very limited....
for below code I am getting above error
using (var connection = new SqlConnection("data source=TP-PC;Persist Security Info=false;database=Asset;user id=sa;password=asd123...;Connection Timeout = 0"))
using (var command = new SqlCommand("codesearch", connection))
{
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddWithValue("@Code", TxtSearch.Text.ToString());
SqlParameter op1 = new SqlParameter();
op1.ParameterName = "@Name";
op1.SqlDbType = System.Data.SqlDbType.VarChar;
op1.Direction = System.Data.ParameterDirection.Output;
SqlParameter op2 = new SqlParameter();
op2.ParameterName = "@Description";
op2.SqlDbType = System.Data.SqlDbType.VarChar;
op2.Direction = System.Data.ParameterDirection.Output;
command.Parameters.Add(op1);
command.Parameters.Add(op2);
connection.Open();
command.ExecuteNonQuery();
connection.Close();
string code1 = op1.Value.ToString();
string code2 = op2.Value.ToString();
}
My procedure
ALTER procedure [dbo].[codesearch]
(
@Code varchar(50),
@Name varchar(50) out,
@Description varchar(50) out
)
AS
Begin
select @Name = Name,@Description = Description from MstAsset where Code= @Code
End
and for below code I am getting int value
using (var connection = new SqlConnection("data source=TP-PC;Persist Security Info=false;database=Asset;user id=sa;password=asd123...;Connection Timeout = 0"))
using (var command = new SqlCommand("codesec", connection))
{
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddWithValue("@Name", TxtSearch.Text.ToString());
SqlParameter op1 = new SqlParameter();
op1.ParameterName = "@ItemKey";
op1.SqlDbType = System.Data.SqlDbType.Int;
op1.Direction = System.Data.ParameterDirection.Output;
command.Parameters.Add(op1);
connection.Open();
command.ExecuteNonQuery();
connection.Close();
string val = op1.Value.ToString();
}
my procedure
ALTER procedure [dbo].[codesec]
(
@Name varchar(50),
@ItemKey int out
)
AS
begin
select @ItemKey =ItemKey from MstAsset where Name= @Name
end
praveenmachat
11-Jul-14 11:24am
View
Can you please provide code sample,
I just need to receive all my out put values (Result of stored procedure) to my C# code
Thanks,
Praveen
praveenmachat
11-Jul-14 11:22am
View
but I am able to get int values
praveenmachat
11-Jul-14 11:21am
View
String[1]: the Size property has an invalid size of 0.
Show More