473,396 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to prompt user for info using stored procedure

Can anyone help me with code to do the following

I have a stored procedure that requires a date. What I
want to do is to write an application that runs that
stored procedure and prompts the user for date/s to be
entered to run the stored procedure.

Can anyone help??

Regards

Newman

Jul 21 '05 #1
1 1562
How much do you have done? You can basically have a form that has a myDate
Property. On it, have a DateTimePicker Control. When the user selects a
date, set the property (How you'll handle it if the user doesn't pick a date
is up to you.) However, once the Ok button (or whatever you want to call it
is clicked, make sure the property is set:

So from the caller, you can do something like this:

myDataForm md = new MyDataForm();
md.ShowDialog();

//When the form is closed, you will have already set the property

SqlCommand cmd = new SqlCommand("usp_MyDateProc", myConnection);

cmd.Parameters.Clear();
cmd.Parameters.Add("@MyDateValue", SqlDbType.SmallDateTime)
cmd.Parameters("@MyDateValue").Value = md.MyDate;

cmd.CommandType = CommandType.StoredProcedure...

i'm leaving out the initialization of the connection, but this should give
you a pretty good idea of what to do.
Cheers,

Bill
"newman" <ne****@businesshelpdesk.com.au> wrote in message
news:07****************************@phx.gbl...
Can anyone help me with code to do the following

I have a stored procedure that requires a date. What I
want to do is to write an application that runs that
stored procedure and prompts the user for date/s to be
entered to run the stored procedure.

Can anyone help??

Regards

Newman

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: ndn_24_7 | last post by:
Hello all, I have a stored procedure that prompts the user for beginning date and ending date to run a monthly report. The prompt says Enter_Beginning_Date and Enter_Ending_Date. I want the prompt...
13
by: dawatson833 | last post by:
I have several stored procedures with parameters that are defined with user defined data types. The time it takes to run the procedures can take 10 - 50 seconds depending on the procedure. If I...
3
by: Tim Thomas | last post by:
Hi, I am very new to .NET and am in the process of building my first web application. I will briefly describe what i am trying to achieve: I have a system where suppliers register their...
1
by: newman | last post by:
Can anyone help me with code to do the following I have a stored procedure that requires a date. What I want to do is to write an application that runs that stored procedure and prompts the user...
10
by: Eric E | last post by:
Hi all, I am using an Access client linked to a PG 7.4 server via ODBC. I have a stored proc on the server that inserts rows into a table.particular table, accomplished via an INSERT within the...
3
by: rsbutterfly16 | last post by:
hi all, I have a front end access database (mdb) with a sql server backend for my tables. I have an form in which I have created a store procedure in sql server, and i have a form created and also...
22
by: Sandman | last post by:
So, I have this content management system I've developed myself. The system has a solid community part where members can register and then participate in forums, write weblogs and a ton of other...
3
by: Bob Alston | last post by:
I have recently been trying to determine the best technique to pull the least amount of info across the LAN link in a slow speed LAN situation (e.g. < 10 Mbps), where data volume = performance. ...
51
by: Ojas | last post by:
Hi!, I just out of curiosity want to know how top detect the client side application under which the script is getting run. I mean to ask the how to know whether the script is running under...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.