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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Bikesh SrivastavaRank #108 · 20.3K reputationPosted Sep 17, 2016, 7:54 PM EDT
Feroz KhanRank #3,748 · 395 reputationPosted Sep 17, 2016, 11:49 PM EDT
HiBikesh Srivastava
i want to create in windows form so how can i ..Guest UserRank #2,002 · 726 reputationPosted Sep 17, 2016, 7:56 PM EDT
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 = "";
}
}
Delpin Susai RajRank #53 · 29.5K reputationPosted Sep 18, 2016, 4:45 AM EDT