|
What is this? You are just trying to Spamming this forum. If you are going to ask question like this, no one will give you the answer. Because you don't know how to ask questions.
No one will going to read your read thousand line of code.
First of all your
Best1 wrote: gForum: ASP.NET
Subject: Displaying a return value from Stored procedure in C#.Net Windows form Application
Your subject says, your problem in your windows application, but you are posting in ASP.NET forum.
Now, come to your answer, If you are returning value form Stored procedure, you can easily read in any variable using Parameter Direction . Now try to googling and try to find some thing on that word , that I have highlighted.
And, from next time rather than posting thousand line of code, please post those line which you thing relevant for question . This will help you to get the answer, and help us to give the answer .
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Two things:
1. This is the ASP.NET forum, you need the WinForms forum
2. Too much code - supply only the relevant part. People are very unlikely to read all that you have supplied - they don't have the time.
|
|
|
|
|
Dude you need to do is something like this. .
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "YourStoredProcedureName";
cmd.Parameters.AddWithValue("FirstName",this.FirstName);
..
..
Parameter param = new Parameter("ID");
param.Direction = Output.
And in Stored procedure it should be like this.
[dbo].[RecordCustomer]
@FirstName char(25),
@LastName char(25),
@EmailAddress char(40),
@ID int output
AS
begin transaction
insert Customers(LastName, FirstName, EmailAddress)
values(@LastName, @FirstName, @EmailAddress)
select @id = @@identity
commit transaction
And to get the value you need to do is
int res = Convert.ToInt32(cmd.Parameters["ID"].Value);
there you get the result..
Do whatever you want to do with it ..
And please post your windows application queries in C# forum
|
|
|
|
|
Hi Friends,
Im creating one shopping cart aplication, im having header section part common in all pages, so i placed it in the master page. In master page im hvng one label as Label Guest. When user logins with their id and after successful login it will redirect to home page,that time the label guest will be change according to their first name. Can anyone tell me how to implement this. The same thing i implemented without master page.
|
|
|
|
|
If you add <%@ MasterType VirtualPath="~/MasterPage.master" %> into the content page (with correct path and filename of course.
Then you can access your label from the content page using Master.Label.Text.
Another method is to use a session variable which can be set from the content page and read from the master page.
|
|
|
|
|
In the master code-behind you could check Request.IsAuthenticated in OnLoad(), if true then set the label.Text = Page.User.Identity.Name.
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Hi all,
I am trying to gather which of the check boxes within the data grid is checked. As far I have tries the following without success:
foreach (GridViewRow row in GridView1.Rows)
{
CheckBox c = (CheckBox)GridView1.Rows[0].Cells[0].FindControl("chkSelection") as CheckBox;
if (c.Checked)
{
Response.Write("Hello");
}
}
How can I know which check boxes were checked in the grid?
Many thanks in advance
Kind regards,
|
|
|
|
|
Where did you write these line of code?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
The code is in a click event of a button on the server side.
regards
JP
|
|
|
|
|
why don't you add columns through property window of datagridview control where you define column name and column type.
For e.g
//Client Side Code
this.dgvVesselDetails = new System.Windows.Forms.DataGridView();
this.IsSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
dgvVesselDetails .Columns.AddRange(new System.web.Forms.DataGridViewColumn[] {
this.IsSelect}
//
// IsSelect
//
this.IsSelect.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
resources.ApplyResources(this.IsSelect, "IsSelect");
this.IsSelect.Name = "IsSelect";
//Server Side Code
foreach (DataGridViewRow row in dgvVesselDetails.Rows)
{
if(row.Cells["IsSelect"].Value)
{
//do stuff
Response.write("Hello World");
}
}
Regards
Annpurna
|
|
|
|
|
Hi All,
I want to install windows service on server.
Is there any tool use for running and installing the service?
On the local machine It works Successfully Now I want to install on the server.
Thanks
Sjs4u
|
|
|
|
|
sjs4u wrote: On the local machine It works Successfully Now I want to install on the server.
How did you install it local system ? you have to do the same thing also in server.
sjs4u wrote: Is there any tool use for running and installing the service?
Go to Visual Studio Command Prompt > Run command : installutil <your servicename.exe=""></your>
BTW : It's not a ASP.NET Question.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
I have a standard datagrid populated from an access database. When i click on edit the datagrid rows are exposed as text boxes and expand across the whole page, is there any easy way to stop this from happening or to limit the size of each tect box while updating
|
|
|
|
|
Use ControlStyle-Width for edit mode width of the boundfield
Use ItemStyle-Width for display mode width of the boundfield
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Hi,
We are using localization in asp.net with resource files.
We have a default.resx resource file for a default.aspx page and a default.aspx.hi-in.resx to support hindi.
The problem is that when we type in hindi in the resource file we see junk characters.
So do we have to install any language pack to the .net solutions in order to support hindi language or fonts.
And also how to load data dynamically to drop down list using resource files for multi-lingual site.
thanks,
sabiha.
|
|
|
|
|
Dear Friends,
I have a web application running from 10 different places. Application Server is their local server. But Database server is same for all. There is only one login ID created for all users to access pages (Form Based Authentication).
Will be any Problem in Sessions ?
Because on my system I logged with that user name. I have used Login View to show login status. I have written logged in Template and Anonymous user Template. When I login it is showing correcty with my name. After some time it is displaying as Guest (login). But I have not logged out. I dont know why it showing so....
Please help me out....
Nayak
|
|
|
|
|
It's more likely that your session has simply died.
Far as I'm concerned, the default timeout for sessions is 10 minutes (or is it 20? I'm not sure).
So even though you have not logged out manually, I am sure you have some facilities in place to do that for you, if the login session is dead.
Now ask yourself how long you had been logged in without performing any postbacks on the page to keep the session alive and see if it exceeded 10 minutes.
... and don't say your query is urgent. It might be to you, but it's totally irrelevant to others.
var question = (_2b || !(_2b));
|
|
|
|
|
Hi,
You are right. But in Web.Config file I have mentioned this line.
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="UseCookies" timeout="1400" />
Still what could be the problem ?
Ramesh Sambari
|
|
|
|
|
It might be because someone else might be logging out , and hence the session object is disposed ..
So you are showed as guest then . .
|
|
|
|
|
Hi,
I have checked this Site on my System. I am the only person logged in. No other user logged in. Even I mentioned the session time to 1400. Still how it is expiring ?
Ramesh Sambari
|
|
|
|
|
You need to check every events in which you are trying to kill the session..
You might be unknowingly calling such events..
Time out is not the problem...
|
|
|
|
|
Hi,
Ya..In Application_Exit event I wrote Session.Abondon() method. After you told, I have removed that. And no more session abondons. But still same problem.
Please help me out...
Ramesh Sambari
|
|
|
|
|
|
Seriously, you post is nothing but a spam for me. Please read forum guideline, and know how to ask good question.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
hi,
first of all let me know what is ur question .
cheers
venu gopal reddy.......
|
|
|
|