Hello,
I am having a button control and gridview control (programmatical ly bind to d/b).When i click on button,fclick() sub is fired.After this the GridView disappears.The buttonclick updates the same table to which gridView is bound.
The subroutine for button click is as below:
------------------------------------------------- - Sub fclick(ByVal o As Object, ByVal e As EventArgs)
-
-
Dim con, rs, rs1, rs2, rs3, tnm, fnm, fieldtype
-
fnm = fnmt.Text
-
tnm = tnmd.SelectedItem.Text
-
fieldtype = fieldtyped.SelectedItem.Text
-
con = Server.CreateObject("ADODB.Connection")
-
con.open("provider=sqloledb;Data Source=dp4;Initial Catalog=svit;User ID=sa;Password=dtpt")
-
rs = Server.CreateObject("ADODB.Recordset")
-
rs.open("alter table " & tnm & " add " & fnm & " " & fieldtype, con)
-
rs1 = Server.CreateObject("ADODB.Recordset")
-
rs1.cursortype = 2
-
rs1.locktype = 3
-
rs1.open("select * from fieldinfo ", con)
-
rs1.addnew()
-
rs1("tnm") = tnm
-
rs1("fnm") = fnm
-
rs1("fieldtype") = fieldtype
-
rs1.update()
-
-
fnmt.Text = ""
-
-
-
-
End Sub
-
<asp:Button ID="Button1" runat="server" Text="Insert Fields" OnClick="fclick"/>
-
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:svitConnectionString7 %>" SelectCommand="SELECT srno, fnm, fieldtype FROM fieldinfo WHERE (tnm = @tnm)" >
-
<SelectParameters>
-
<asp:SessionParameter Name="tnm" SessionField="user1" Type="String" />
-
</SelectParameters>
-
<DeleteParameters>
-
<asp:ControlParameter ControlID="GridView1" Name="srno" PropertyName="SelectedValue" />
-
</DeleteParameters>
-
</asp:SqlDataSource>
-
-
-
<asp:GridView ID="GridView2" runat="server" OnSelectedIndexChanged="selch" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
-
<Columns>
-
<asp:BoundField DataField="srno" HeaderText="srno" InsertVisible="False" ReadOnly="True"
-
SortExpression="srno" />
-
<asp:BoundField DataField="fnm" HeaderText="fnm" SortExpression="fnm" />
-
<asp:BoundField DataField="fieldtype" HeaderText="fieldtype" SortExpression="fieldtype" />
-
<asp:ButtonField CommandName="Select" Text="Delete" />
-
</Columns>
-
</asp:GridView>
---------------------------------------------
Please help me in this matter as soon as possible.
0 1172 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Miguel Dias Moura |
last post by:
Hello,
I have a GridView in my page which is created in runtime. It works fine.
My page has 2 Asp Buttons:
- The HIDE button makes GridView.Visible = False;
- The SHOW button makes GridView.Visible = True.
I press HIDE and the GridView disappears as expected.
After it I press SHOW and the GridView doesn't show.
|
by: willip |
last post by:
I have a Gridview control with a Databound Hyperlink. e.g.:
<asp:HyperLinkField HeaderText="MyTitle" DataNavigateUrlFields="MyID"
DataNavigateUrlFormatString="~/ShowMe.aspx?MyID={0}"
DataTextField="MyTitle" SortExpression="MyTitle">
With Norton Ad Blocking turned "Off" this works fine.
Turn Norton Ad Blocking "On" and the rest of the Gridview displays, but any
Hyperlinks have gone!
|
by: sck10 |
last post by:
Hello,
I have a GridView that I built to show the files in a directory. The
problem that I am having is that when I click on the second page (2), the
GridView disappears. Also, I can't sort by any of the columns.
Below is the code that I am using. Any help would be appreciated.
Thanks, sck10
|
by: sck10 |
last post by:
Hello,
I have a GridView that I built to show the files in a directory. The
problem that I am having is that when I click on the second page (2), the
GridView disappears. Also, I can't sort by any of the columns.
Below is the code that I am using. Any help would be appreciated.
Thanks, sck10
|
by: antonyliu2002 |
last post by:
I've been googling for some time, and could not find the solution to
this problem.
I am testing the paging feature of gridview. I have a very simple web
form on which the user can select a few fields to be included in the
table, which is to be bound to the gridview.
The web form looks like so (Don't worry about the stupidity of this
web form for now.):
| |
by: Don Miller |
last post by:
Without a SQLDataSource declaratively linked to a GridView, I
programmatically create a dataset and bind it to a GridView with
EnableSortingAndPagingCallbacks=True and Paging=True. The GridView displays
(in a View of a MultiView) but when I press the page numbers to page through
the dataset, the GridView disappears completely (is not rendered) without a
postback. When I take action (press a button) to show the GridView again,
the GridView...
|
by: Froefel |
last post by:
I'm very new to the ADO.NET and WebForms arena, so the problem that
I'm having is probably trivial.
Using VS2005, I'm just creating a small test project that has a text
box allowing you to enter a SQL statement, a button to execute the
statement and a GridView control to display the results. The GridView
control should AllowPaging and AllowSorting. The data comes from a SQL
datasource, which I access through a connection string stored in...
|
by: John Devlon |
last post by:
Hi,
I've placed a gridview on a page but it disappears when there is no data.
How do i keep the gridview visible, even when there is no data ?
(headers etc)
Thanx
John
|
by: edurazee |
last post by:
I am able to create BoundFields and Footer-rows dynamically like this in my GridView:
protected void Page_Load(object sender, EventArgs e)
{
CreateGridView();
}
private void CreateGridView()
{
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |