Hello,
I have a web form that allows the user to move a unit on a
manufacturing router. The user click one of five buttons which each
represent a step on the router. When the user clicks any of the five
buttons, I do a SQL select to gather some data about this unit and
populate a datagrid w/ the resulting data. I want the data in the
datagrid to be displayed to the user, and THEN I want to prompt the
user w/ a messagebox(), that ask them "Do you want to process this
move request? YES or NO". The problem is when I bind the datagrid it
does NOT display on the form until after the user answers the YES or
NO question, even though I load and bind the datagrid before I prompt
the user w/ the MESSAGEBOX() function. What do I need to do, to have
the datagrid data displayed before the MESSAGEBOX pops up, so the user
can see the datagrid data to make the right answer to the MESSAGEBOX?
The code is listed below. Any help will be greatly appreciated.
Thanks...
NOTE: some of the variables used in the functions are declared
earlier
public
user clicks one of the five router step buttons
and the ConfirmRequest( ) function is called
Private Function ConfirmRequest( ByVal ToOperation As String) As
String
Dim Result1 As Boolean
Dim UpdateDatabaseR esponse As String
Dim Message As String = "Do you want to process this move
request?"
Dim Caption As String = "A T T E N T I O N!!"
Dim Buttons As MessageBoxButto ns = MessageBoxButto ns.YesNo
Dim Result As DialogResult
'Call the function that loads & binds the datagrid w/ this
units data.
Result1 = DispComponentDa ta("PARAM1")
Result = MessageBox.Show (Message, Caption,
MessageBoxButto ns.YesNo, _
MessageBoxIcon. Question, MessageBoxDefau ltButton.Button 1,
MessageBoxOptio ns.ServiceNotif ication)
' If the user clicked YES to this response we will proceede to
update
the MFG Items & Active Tables.
If Result = DialogResult.Ye s Then
UpdateDbRespons e = UpdateDatabase( ToOperation, "parm2",
"parm3")
Return "YES"
Else
Return "NO"
End If
End Function
Private Function DispComponentDa ta(ByVal param1 As String) As
Boolean
Dim myConnection As OleDbConnection
Dim myCommand As OleDbDataAdapte r
Dim ds As New DataSet()
Dim ConnStr As String
Dim SQL As String
'Connection syntax
ConnStr = "Provider=OraOL EDB.Oracle.1;Pe rsist Security
Info=False;User ID=sfdm;Passwor d=icc8336;Data
Source=housys.w orld;Extended Properties="
myConnection = New OleDbConnection (ConnStr)
'DataSetCommand
' N O T I C E: Take the hardcoded values out of this code.
Replace w/ the variables.
SQL = "SELECT b.comppart||' '||b.comprevisi on AS
COMP_REV,b.Comp SFCnumber,NEW_T IME(TO_DATE('01 0170','mmddrr') +
b.tstamp/86400,'GMT','CS T') EnteredDate "
SQL = SQL + "FROM BUILDHISTORY b,ROUTSTEP r "
SQL = SQL + "WHERE b.sfcnumber = 'EA03LDNB2W' "
SQL = SQL + "AND b.step >= 20 "
SQL = SQL + "AND b.status = 'ACTIVE' "
SQL = SQL + "AND r.routername = 'ECG' "
SQL = SQL + "AND b.step = r.step(+) "
SQL = SQL + "ORDER BY b.tstamp"
'SQL = "select * from Masters"
myCommand = New OleDbDataAdapte r(SQL, myConnection)
'use Fill method of DataSetCommand to populate dataset
myCommand.Fill( ds, "BUILDHISTO RY")
Me.DataGrid1.Vi sible = True
'Binding a Grid
Me.DataGrid1.Da taSource =
ds.Tables("BUIL DHISTORY").Defa ultView
Me.DataGrid1.Da taBind()
Me.DataGrid1.Vi sible = True
myConnection.Cl ose()
Return True
End Function 0 1591 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Stephen |
last post by:
I've got a datagrid with a remove button and I would like to add some code in
the code behind page so as whenthe button is clicked the corresponding row in
the datagrid is removed. The Datagrid is populated by the items in an
arraylist shown in the code below. When the button is clicked I would also
like the code to remove the items from the Arraylist. I've very little
experience working with datagrids and arraylists so im finding this...
|
by: Reb |
last post by:
I am using a datagrid within another datagrid. My second
datagrid is expand/collapse one. I am facing some error.
This is my code.
ExpandGrid.aspx
<form id="Form1" method="post" runat="server">
<asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT:
8px; POSITION: absolute; TOP: 8px" runat="server"
BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px"
|
by: Jim Heavey |
last post by:
Trying to figure out the technique which should be used
to add rows to a datagrid. I am thinking that I would
want an "Add" button on the footer, but I am not quite
sure how to do that. Is that the best method? Do you
have a sample of how to do this?
|
by: DC |
last post by:
Dear ASP.Net Experts,
In ASP, I can write something like this:
<table>
<tr>
<th align=left>ID</th>
<th align=left>Product Name</th>
<th align=left>Price</th>
</tr>
<%
|
by: DC Gringo |
last post by:
I have a datagrid that won't sort. The event handler is firing and return
label text, just not the sort.
Here's my Sub Page_Load and Sub DataGrid1_SortCommand:
--------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
| |
by: CVerma |
last post by:
Hi,
I have an embedded datagrid within a datalist. I am not able to
perfrom paging in the datagrid. Any ideas? Here is my code:
Here is my Simplegrid.cs file:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
|
by: A P |
last post by:
Hi!
I have created a sample datagrid that can update data on a database. Please
help me solve the problem, I have attached both aspx and code behind
(aspx.vb):
______________________
datagrid.aspx
|
by: tshad |
last post by:
Is there a way to carry data that I have already read from the datagrid from
page to page?
I am looking at my Datagrid that I page through and when the user says get
the next page, I have to go to the database to get the next page. Is there
a way to use the dataset to allow us to read back and forth in it instead of
going back to the database to get it?
Thanks,
|
by: rupalirane07 |
last post by:
Both grids displays fine. But the problem is only parent datagrid sorting works fine but when i clik on child datagrid for sorting it gives me error:
NullReferenceException error
Any help........pls urgent
=========================================================
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm3.aspx.vb" Inherits="TestDatagrids.WebForm3"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
| |
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...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
| |