|
INSERT INTO Registration ([DATE OF BIRTH],[CONTACT NUMBER]) VALUES('" + DateT.Text + "','" + ContactT.Text + "')
Be aware from SQL Injections!
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
I have created a registration form. The details of this registration form should be stored in table.
How to do that and what is the syntex for insert.
|
|
|
|
|
You want that someone write code for you (absolutely free ).
First read some beginner's book on C# and SQL.
Be an Eagle, Sky is Yours.
|
|
|
|
|
If u dont mind than can u suggest me some books for thi
|
|
|
|
|
insert into tbl_name(coulmn_names separated by commas) values(Values to be insert)
|
|
|
|
|
Hi guys, I'm trying to built a grid view from scratch, create it then do all the bindings by code, do u know of any good articles related to this matter ?
thanx
Mr.K
|
|
|
|
|
|
Hi All,
I want to integrate flex(Adobe ) with ASP.Net can anyone help me to find out the way .
Thanks
Amit Patel
|
|
|
|
|
The only thing that i can send from client side to side is string. Is it right or wrong????
If right,why it is being so.
if wrong, then what are all things i can send from client to server
thanks
regards
Subramanian
|
|
|
|
|
Hi,
not sure if I got your question right. Which technology do you use? Lowlevel TCP/IP or higher like ASP.NET.
I would say that communicating at a low level (like TCP/IP) everything sent from client to server are bytes. These will be interpreted as string. Since nearly each type has a string representation you can send everything from client to server. It is just a matter of the layer above TCP/IP to build an object from a special type from the received string.
Regards
Sebastian
|
|
|
|
|
Hi all,
I have a gridview control in asp.net 2.0,and some datas are binding from the database.If there is no data in the databse,then the grid is not displayed.Is it possible to display the grid without any data.The data is added by <boundfield>
Thanks
Denny
|
|
|
|
|
by assigning a empty datatabel with relevant column name can be useful.
eg:
DataTable dt = new DataTable();
dt.Columns.Add("dummy");
dt.Rows.Add();
GridView1.DataSource = dt;
GridView1.DataBind();
//but this is not a best practise....
|
|
|
|
|
<
DataTable source = new DataTable();
gridViewAppointment.DataSource = source;
// New empty row is added to the grid view to dis play the data table.
source.Rows.Add(source.NewRow());
gridViewAppointment.DataBind();
int columnsCount = gridViewAppointment.Columns.Count;
gridViewAppointment.Rows[0].Cells.Clear();// clear all the cells in the row
gridViewAppointment.Rows[0].Cells.Add(new TableCell()); //add a new blank cell
gridViewAppointment.Rows[0].Cells[0].ColumnSpan = columnsCount;
gridViewAppointment.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Center;
gridViewAppointment.Rows[0].Cells[0].ForeColor = System.Drawing.Color.Red;
gridViewAppointment.Rows[0].Cells[0].Font.Bold = true;
// set No Results found to the new added cell
gridViewAppointment.Rows[0].Cells[0].Text = "No Appointment Found!";
>
yes it is possible but u have to display some message like no recordfound
first create the data table bind it with grid view
then get column count
clear all cells then join all column through colspan then add text
|
|
|
|
|
I m new for asp.net... i want to create login page with validation... so pls send me a code.... I m using user and passward in front page.. pls reply... am writing code in C#.net
|
|
|
|
|
If you're new to ASP.NET, you should NOT be writing security based code. I can only assume this is paid work and that you're one of the hordes of unskilled third world programmers ripping off western companies ( although they deserve it to think they can get real code for what they pay you ).
It's really trivial - you have a username and a password. You write sql to check them in the database. You use the session to store if someone is logged in, so other pages can refer to the login page if the user is not logged in. There's a component in ASP.NET that does it, but I never use it, when I did it was more hassle than it was worth.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: third world programmers
Very harsh Christian , you don't have any rights to abuse any one please you read guidelines before answering any question as it put by the chris maunder and atleast this should not be from your side.
|
|
|
|
|
Christian Graus wrote: one of the hordes of unskilled third world programmers ripping off western companies
world is progressing,
the gap between east and west is narrowing,
and we have here some VERY narrow minded people ...
Grow up .... man ... please grow up ...
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
|
1 - Spoon feeding is bad.
2 - If you are spoon feeding, make sure what you are feeding is correct.
The code you have posted has got many flaws including SQL injection.
|
|
|
|
|
Please, don't offer code like this, it helps nobody. The guy has taken on a job for which he has no clue what he is doing, so the client is going to get ripped off - his own fault, he should ask for references first, but anyway. Once the guy has used your (dodgy) code to create a login he will ask how to do the next bit of his spec, and before you know it you have written the entire thing.
The simple fact is that people like this a) give a bad impression of developers in general and b) by bidding stupidly low take jobs away from people who can actually do them, but for a realistic price.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Hi to all,
I am working on a shopping cart project. Here the scenerio is, if the admin adds a new category, that should be shown in the menu. If the admin adds a new sub category , then it should be displayed as the child item of the main category.
Can anybody suggest me how to achieve this.
cheers
sneha
cheers,
sneha
|
|
|
|
|
A dynamic menu will be done using javascript. Just look at any of the menus that exist on the web and work out how to make one work using dynamic properties instead of a static file, or even just write that file as needed.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thank you for replying. I did like this:
using System;
using System.Configuration;
using System.Collections;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
string name;
protected void Page_Load(object sender, EventArgs e)
{
if(!Page.IsPostBack)
{
populate_menu();
}
}
DataSet GetMenuData()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["newcon"].ConnectionString);
SqlCommand cmd = new SqlCommand();
ArrayList arl = new ArrayList();
cmd.Connection = con;
cmd.CommandText = "select * from CATEGORY ";
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
cmd.Connection.Open();
sda.Fill(ds, "CATEGORY");
return ds;
}
public void populate_menu()
{
DataSet ds = GetMenuData();
foreach(DataRow drow in ds.Tables["CATEGORY"].Rows)
{
MenuItem masteritem = new MenuItem((string)drow["category_name"]);
name = masteritem.Text;
get_id();
int par_id = Convert.ToInt32 (ViewState["p_id"]);
if (par_id == 0)
{
Menu1.Items.Add(masteritem);
}
else
{
Menu1.Items.Add(masteritem);
}
}
}
public void get_id()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["newcon"].ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "select parent_id from CATEGORY where category_name='"+name+"'";
cmd.Connection.Open();
int pa_id = Convert.ToInt32(cmd.ExecuteScalar());
ViewState["p_id"] = pa_id;
}
}
From this I am getting output like this:
Catering
Plastics
Glassware
cheers,
sneha
|
|
|
|
|
Looks about right. You're not adding subitems, you're adding all your items to the one menu
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
public void populate_menu()
{
DataSet ds = GetMenuData();
foreach(DataRow drow in ds.Tables["CATEGORY"].Rows)
{
MenuItem masteritem = new MenuItem((string)drow["category_name"]);
name = masteritem.Text;
get_id();
par_id = Convert.ToInt32 (ViewState["p_id"]);
if (par_id == 0)
{
Menu1.Items.Add(masteritem);
}
else
{
get_category_name();
ca_name = ViewState["cname"].ToString();
Menu1.Items[0].ChildItems.Add(masteritem);
}
}
}
In this I am unable to find the menu index of a particular category. In this I just tried by giving it as "0".
I want the menuindex based on the category name "ca_name".
cheers,
sneha
|
|
|
|