473,776 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to pass SQL Command and Parameters to another form?

Tim
Hi,

I am trying to pass a SQL Command, complete with parameters and their values
from one form to a modal form.

The modal form has;
public void GridDataPreload (System.Data.Sq lClient.SqlComm and cmdPreload)
{
}

the calling form has;
fSaleItems.Grid DataPreload(thi s.cmmSQLUpdateS aleReview);

At the point it is called the cmmSQLUpdateSal eReview has all the params and
their values in it.

When it is passed though it has the right count but none of the value names
(such as @Sale_id) and none of the values.

What has happened to them?

Tim
Nov 17 '05 #1
3 1856
Hi,

post the code where you instantiate and pass the command to the modal form.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Tim" <ti*@home.com > wrote in message
news:tT******** ***********@new s20.bellglobal. com...
Hi,

I am trying to pass a SQL Command, complete with parameters and their
values from one form to a modal form.

The modal form has;
public void GridDataPreload (System.Data.Sq lClient.SqlComm and cmdPreload)
{
}

the calling form has;
fSaleItems.Grid DataPreload(thi s.cmmSQLUpdateS aleReview);

At the point it is called the cmmSQLUpdateSal eReview has all the params
and their values in it.

When it is passed though it has the right count but none of the value
names (such as @Sale_id) and none of the values.

What has happened to them?

Tim

Nov 17 '05 #2
Tim
Hi Ignacio here is the code: I instantiate the form set the command and then
show the form modally. Hoping you can help. Tim

MM.Forms.frmSel ectSaleItems fSaleItems = new frmSelectSaleIt ems();
fSaleItems.Grid DataPreload(thi s.cmmSQLUpdateS aleReview);
this.Cursor = Cursors.Default ;
if (fSaleItems.Sho wDialog(this) == System.Windows. Forms.DialogRes ult.OK)
{
itemSelect = true;
this.EnableDisa bleNextButton() ;
this.btnReviewI tems.Enabled = true;
}

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us > wrote
in message news:ef******** ********@TK2MSF TNGP09.phx.gbl. ..
Hi,

post the code where you instantiate and pass the command to the modal
form.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Tim" <ti*@home.com > wrote in message
news:tT******** ***********@new s20.bellglobal. com...
Hi,

I am trying to pass a SQL Command, complete with parameters and their
values from one form to a modal form.

The modal form has;
public void GridDataPreload (System.Data.Sq lClient.SqlComm and cmdPreload)
{
}

the calling form has;
fSaleItems.Grid DataPreload(thi s.cmmSQLUpdateS aleReview);

At the point it is called the cmmSQLUpdateSal eReview has all the params
and their values in it.

When it is passed though it has the right count but none of the value
names (such as @Sale_id) and none of the values.

What has happened to them?

Tim


Nov 17 '05 #3
Ron
Pass the command as an argument in the Form's constructor. That should work OK.

"Tim" wrote:
Hi Ignacio here is the code: I instantiate the form set the command and then
show the form modally. Hoping you can help. Tim

MM.Forms.frmSel ectSaleItems fSaleItems = new frmSelectSaleIt ems();
fSaleItems.Grid DataPreload(thi s.cmmSQLUpdateS aleReview);
this.Cursor = Cursors.Default ;
if (fSaleItems.Sho wDialog(this) == System.Windows. Forms.DialogRes ult.OK)
{
itemSelect = true;
this.EnableDisa bleNextButton() ;
this.btnReviewI tems.Enabled = true;
}

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us > wrote
in message news:ef******** ********@TK2MSF TNGP09.phx.gbl. ..
Hi,

post the code where you instantiate and pass the command to the modal
form.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Tim" <ti*@home.com > wrote in message
news:tT******** ***********@new s20.bellglobal. com...
Hi,

I am trying to pass a SQL Command, complete with parameters and their
values from one form to a modal form.

The modal form has;
public void GridDataPreload (System.Data.Sq lClient.SqlComm and cmdPreload)
{
}

the calling form has;
fSaleItems.Grid DataPreload(thi s.cmmSQLUpdateS aleReview);

At the point it is called the cmmSQLUpdateSal eReview has all the params
and their values in it.

When it is passed though it has the right count but none of the value
names (such as @Sale_id) and none of the values.

What has happened to them?

Tim



Nov 17 '05 #4

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

Similar topics

7
2320
by: qazmlp | last post by:
void func() { // Is it by anyway possible to read the value of the first command line parameter i.e. argv here ? } int main() { func() ; // No command line arguments are passed to func(). }
3
3890
by: Lyn | last post by:
Hi, I have been experiencing a problem passing a LIKE statement in the WHERE argument of a DoCmd.Openform statement. I have posted that issue separately. However, in an attempt to work around the problem, I thought of using OPENARGS to pass information to the form being opened (instead of using WHERE). In the parent form, I have generated a RecordSet (RS) with the information
7
21635
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the server ? Is it possible to use parameters in pass-through queries ? An additional question: Is it possible to connect to a database on MySQL or PostgreSQL using ADO ? Is it possible to execute pass-through queries with parameters, using ADO...
0
3322
by: Zlatko Matić | last post by:
Hi everybody! Recently I was struggling with client/server issues in MS Access/PostgreSQL combination. Although Access is intuitive and easy to use desktop database solution, many problems appear when someone is trying to use it as front-end for real server database systems such as PostgreSQL or MySQL. One of these problems is regarding pass-through queries and parameters. I wanted to have all the code on client, while executing it on...
3
8219
by: Joseph Lu | last post by:
Hi, all I have a stored procedure created in SQL Server like the following lines. // stored proceudre code starts here CREATE PROCEDURE sp_insertdata @strdata varchar(250) , @rsult BIT OUTPUT , @erridx CHAR(7) OUTPUT
1
10483
by: Mayhem05 | last post by:
I have an Access 2003 database that I need to write some VBA code for to populate a table. The table is based on a query I have built in Access queries. Right now I have 2 parameters that are passed to the query from a form (DateFrom and DateTo). When I open the form and populate the variables (DateFrom and DateTo) then open the query it works fine. My problem is that I need to do this from VBA coding and pass the 2 parameters to the...
3
5254
by: epfmy | last post by:
Hi I want to ask... A report is using a query as record source. That query has parameters and . A command button in a form open that report. That form contains 2 textbox for date. How can I pass this 2 textbox as the parameters of the query?
24
55236
by: =?Utf-8?B?U3dhcHB5?= | last post by:
Can anyone suggest me to pass more parameters other than two parameter for events like the following? Event: Onbutton_click(object sender, EventArgs e)" Event handler: button.Click += new EventHandler(Onbutton_click); I want to pass more information related that event. & want to use that
12
11111
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms. Here is a newbie mistake that I found myself doing (as a newbie), and that even a master programmer, the guru of this forum, Jon Skeet, missed! (He knows this I'm sure, but just didn't think this was my problem; LOL, I am needling him) If...
0
10122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9923
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7471
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5368
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5497
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4031
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2860
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.