473,383 Members | 1,785 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,383 software developers and data experts.

insert function

hello.. i am new here and need some help in vb.net!!

i need to do an insert function.. for example: there are some checkboxes. if the box is checked and a user clicks the button 'select', the item that had been checked will show up in other page.
the problem is i don know how to retrive data from database once user click the button 'select'

thats all, thank you!!
Jul 25 '07 #1
6 1660
Hi, try the link below, it is written in C# . If you want to convert it to VB.NET go to the link below it. Hope that helps.

http://www.codetoad.com/asp.net/aspnetcontrols12.asp

Convert C# to VB.NET
http://www.developerfusion.co.uk/uti...sharptovb.aspx
Jul 25 '07 #2
thanks for the reply..

i need to show the checked item on the other page. the item selected is retrieve from database.
the problem is i don know how to pass the checked item to other page and how to retrive from database as well..

pls help, urgent!!
Jul 25 '07 #3
If your still interested in having your problem solved PM.
Jul 25 '07 #4
help me..... urgent!!

how to call checkbox in the grid and post the checked box value to other page??
Jul 26 '07 #5
vee10
141 100+
help me..... urgent!!

how to call checkbox in the grid and post the checked box value to other page??

hi

this below code may solve ur problem
Expand|Select|Wrap|Line Numbers
  1.  <asp:GridView ID="GridView1" runat="server" Font-Italic="True" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
  2.             <Columns>
  3.             <asp:TemplateField HeaderText="Select">
  4.            <HeaderStyle HorizontalAlign="Center" />
  5.            <ItemStyle HorizontalAlign="center" />
  6.            <ItemTemplate>
  7.            <asp:CheckBox runat="server" ID="chkSelect" Checked='False' />
  8.            </ItemTemplate>           
  9.             </asp:TemplateField>
  10.             </Columns>
  11.         </asp:GridView>
  12.  
javascript to read the checkbox value

alert(document.getElementById("GridView1_ctl02_chk Select").checked);

and if next row u want the checkboxvalue
then "GridView1_ctl03_chkSelect" and soon increment the integer value until the last row

Now u want to pass the value to other page then place it in cookie

document.cookie ="checkboxValue = " + document.getElementById("GridView1_ctl02_chkSelect ").checked;
then
in that page when loading the page retrieve the cookie value for the above

Expand|Select|Wrap|Line Numbers
  1.  
  2. <html >
  3. <head runat="server">
  4.     <title>Untitled Page</title>
  5.     <script type="text/javascript">
  6.     function insertValue()
  7.     {
  8.     debugger
  9.     if(document.cookie.indexOf("checkboxValue=") != -1)
  10.     {
  11.  
  12.     document.getElementById("textBox").value =document.cookie.substring(document.cookie.indexOf("=")+1);
  13.     }
  14.     }
  15.     </script>
  16. </head>
  17. <body  onload = "return insertValue();">
  18.     <form id="form1" runat="server">
  19.     <div>
  20.     <input type = "text" id ="textBox"/>
  21.     </div>
  22.     </form>
  23. </body>
  24. </html>
  25.  
  26.  
if u want to know more about the checkbox retrieving and cookies refer to this references

http://www.thescarms.com/dotnet/webdatagrid.aspx
http://echoecho.com/jscookies02.htm
Jul 26 '07 #6
thanks for the reply. but i am still blur about it.

i put the code to the page below in the page that use by user to check the box name 'order.aspx'

Code: ( text )
<asp:datagrid ID="Grid" runat="server" Font-Italic="True" OnSelectedIndexChanged="Grid_SelectedIndexChanged" >
<Columns>
<asp:TemplateField HeaderText="Select">
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="center" />
<ItemTemplate>
<asp:CheckBox runat="server" ID="Checkbox2" Checked='False' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

then in the page of retrive data named 'showOder.aspx':

Code:
function insertValue()
{
debugger
if(document.cookie.indexOf("checkboxValue") != -1)
{
document.getElementById("DataGrid1").value =document.cookie.substring (document.cookie.indexOf ("=")+1);
alert(document.getElementById("Grid_ctl02_Checkbox 2").checked);
document.cookie="checkboxValue="+document.getEleme ntByld("Grid_ctl01_Checkbox2").checked;
self.closed();
}
}

i try with selecting one checked box only.Am i doing wrong on this? Because i still can not get the data when i click the button select.
Jul 27 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: george | last post by:
This is like the bug from hell. It is kind of hard to explain, so please bear with me. Background Info: SQL Server 7.0, on an NT box, Active Server pages with Javascript, using ADO objects. ...
8
by: Johannes A. Brunner | last post by:
Got a simple problem. I code some site and because Im a freak I made my own session-handling. When a user open up my site it will check if there is a ssid in the url if not generate one. this will...
2
by: Polyhedron_12 | last post by:
I am having problems calling functions in general in VB. I keep getting alot of errors. Can anybody help me out with this? I put the error message on the same line that it says it is at. I believe...
14
by: Chris Ochs | last post by:
The documentation doesn't have any examples of using an sql language function to do an insert, andI am at loss as to I am doing wrong here. The error I get trying to create the function is: ERROR:...
8
by: Marvin McNett | last post by:
How do I go about ensuring that data is only added to a table through a function? I've tried granting execute persission on the function which inserts data, but can't get it to work unless the...
4
by: neilcancer | last post by:
i wrote a function to insert an elem into a list, but it was wrong,wrong,wrong! and i have no idea about why it was wrong. If anyone know, leave your advice, thank you. #include<stdio.h>...
6
by: flash | last post by:
write a program that manipulates arrays of integers. The main program should call three functions: Insert, Delete, and Search. The Insert function should call a function Sort that sorts the array. ...
6
by: askmatlab | last post by:
Hello all: I would like to insert a number into a linked list in ascending order. Is the following function correct? void insert(Node **node, int v) { Node *tmp = (Node...
6
by: rn5a | last post by:
During registration, users are supposed to enter the following details: First Name, Last Name, EMail, UserName, Password, Confirm Password, Address, City, State, Country, Zip & Phone Number. I am...
0
by: troydixon | last post by:
Hello, I am new at this, and have been trying to insert data into a table by using the footer of a gridview (which I dont like) or by using a detials view on the same page that is doing the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.