Hi All,
I want to create form design same like attached file. please help me about this can i create.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Delpin Susai RajPosted Sep 18, 2016, 8:45 AM
Feroz KhanPosted Sep 18, 2016, 3:49 AM
HiBikesh Srivastava
i want to create in windows form so how can i ..Guest UserPosted Sep 17, 2016, 11:56 PM
Step 1 Create your database and table
Here is your complete code
Source code Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>title>
head>
<body>
<form id="form1" runat="server">
<div>
<table class="auto-style1" align="center">
<tr>
<td colspan="2">
<h1>Attech fileh1>
td>
tr>
<tr>
<td>file name
td>
<td>
<asp:TextBox ID="TextBox1" runat="server">asp:TextBox>
td>
tr>
<tr>
<td>Upload filetd>
<td>
<asp:FileUpload ID="FileUpload1" runat="server" />td>
tr>
<tr>
<td>
<asp:Button ID="Button1" runat="server" Text="Upload" OnClick="Button1_Click" />td>
tr>
table>
div>
form>
body>
html>
Step 3 : Add a folder in your solution Explorer
Step 4: Code file Default.aspx.cs
using System;
using System.Data.SqlClient;
using System.Configuration;
using System.IO;
public partial class _Default : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Connectionstring"].ConnectionString);
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string myfile;
if (FileUpload1.HasFile)
{
string sExtension = Path.GetExtension(FileUpload1.FileName);
FileUpload1.SaveAs(Request.PhysicalApplicationPath + "\\NewFolder1\\" + FileUpload1.FileName);
myfile = "~\\NewFolder1\\" + FileUpload1.FileName;
}
else
{
myfile = "";
}
con.Open();
cmd = new SqlCommand("insert into file values('" + TextBox1.Text + "','"+myfile +"')", con);
cmd.ExecuteNonQuery();
con.Close();
Response.Write("");
TextBox1.Text = "";
}
}
Bikesh SrivastavaPosted Sep 17, 2016, 11:54 PM