My code is
CODE
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title> Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
1. aaa ....<br />
<asp:RadioButton ID="RadioButton1" runat="server" Style="z-index: 100; left: 54px;
position: absolute; top: 81px" GroupName="a" Height="20px" Text="One" Width="58px" />
<asp:RadioButton ID="RadioButton2" runat="server" Style="z-index: 101; left: 186px;
position: absolute; top: 78px" GroupName="a" Height="20px" Text="Two" Width="53px" />
<asp:RadioButton ID="RadioButton3" runat="server" Style="z-index: 102; left: 331px;
position: absolute; top: 80px" GroupName="a" Text="Three" Width="125px" />
<br />
<br />
<br />
2. bbb.....<br />
<asp:RadioButton ID="RadioButton4" runat="server" GroupName="b" Height="20px" Style="z-index: 103;
left: 54px; position: absolute; top: 209px" Text="One" Width="58px" />
<asp:RadioButton ID="RadioButton5" runat="server" GroupName="b" Height="20px" Style="z-index: 104;
left: 186px; position: absolute; top: 203px" Text="Two" Width="53px" />
<asp:RadioButton ID="RadioButton6" runat="server" GroupName="b" Style="z-index: 106;
left: 331px; position: absolute; top: 204px" Text="Three" Width="125px" />
<br />
<br />
3. ccc...<br />
<asp:RadioButton ID="RadioButton7" runat="server" GroupName="c" Height="20px" Style="z-index: 108;
left: 54px; position: absolute; top: 331px" Text="One" />
<asp:RadioButton ID="RadioButton8" runat="server" GroupName="c" Height="20px" Style="z-index: 105;
left: 186px; position: absolute; top: 330px" Text="Two" />
<asp:RadioButton ID="RadioButton9" runat="server" GroupName="c" Style="z-index: 107;
left: 331px; position: absolute; top: 328px" Text="Three" />
<br />
<br />
<br />
<asp:Button ID="Submit" runat="server" Style="z-index: 110; left: 211px; position: absolute;
top: 411px" Text="Submit" />
<br />
</div>
</form>
</body>
</html>
Protected Sub Submit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Submit.Click
Dim sqlcn As New SqlConnection
Dim sqlcd As New SqlCommand
Dim SqlStr As String
sqlcn.ConnectionString = "XXXX"
sqlcn.Open()
SqlStr = " "
sqlcd.CommandText = SqlStr
sqlcd.Connection = sqlcn
sqlcd.ExecuteNonQuery()
sqlcd = Nothing
End Sub
End Class
How to write sql statement to insert values of selected radio buttons into database?
Database column names are a1,a2,a3
Thanks
This post has been edited by nikith: 19 Sep, 2008 - 07:23 AM