|
mm workin on .net 2.0 which does not support pageinit event.
is there any other way...
|
|
|
|
|
mylogics wrote: mm workin on .net 2.0 which does not support pageinit event.
In ASP.NET 2.0 you can use Page_Init or can override OnInit.
|
|
|
|
|
you seem a little thick. You are posting the same question day after day. Day after day, you get the same answer, which assumes that you're using .NET 3.5. You know you're not, so you need to make that clear. In any case, every day, you're being given the same information. Are you just blindly asking this day after day, without ever writing any code ? Post the code you've written, so we can help you progressively, instead of people giving you the same answer, every day.
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 all,
In my gridview i have to select as well as update for which am using two link btns,am using a sr_no as the datakeyname and when i write string s = GridView1.SelectedValue.ToString(); for getting the sr_no it works fine in the selected index changed but i cannot get the sr_no when am using it for updation in the
gridview1_rowupdating() event ...
is there any way i can get the selected value of the gridview as it is important that i have 2 buttons in the gridview
.
|
|
|
|
|
try this,
gvwName.DataKeys[e.RowIndex].Value
|
|
|
|
|
|
Flavia A wrote: Thanks it worked
|
|
|
|
|
I am using this code FileUpload2.PostedFile.SaveAs(Server.MapPath("~\\Images\\") + "Image" + txtRefNumber.Text + ".jpg"); to save images in host but it doesn't save image on host.
|
|
|
|
|
fattycode wrote: to save images in host but it doesn't save image on host.
What does it mean ? Are you getting any error ? or what ?
You are talking about Hosting on IIS or Running your Application From Visual Studio ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I have my webproject in host and i had problem with premissions,I made premission changes on control panel and now is working good.
Thanks for your time.
|
|
|
|
|
fattycode wrote: I made premission changes on control panel
Yes ! That's why I asked you the question, what is the problem if you are hosting on server, you have to give Write Access permission to that folder where you are uploadinf the file.
fattycode wrote: now is working good.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi am quite new to programming and am trying my hands on some codes i copied from the net but am facing these problems
"
Error 1 Program 'C:\Users\Nancy\Documents\Visual Studio 2008\Projects\softwaree\softwaree\obj\Debug\softwaree.exe' has more than one entry point defined: 'softwaree.Program.Main()'. Compile with /main to specify the type that contains the entry point. C:\Users\Nancy\Documents\Visual Studio 2008\Projects\softwaree\softwaree\Program.cs 14 21 softwaree
AND
Error 2 Program 'C:\Users\Nancy\Documents\Visual Studio 2008\Projects\softwaree\softwaree\obj\Debug\softwaree.exe' has more than one entry point defined: 'softwaree.Form2.Main()'. Compile with /main to specify the type that contains the entry point. C:\Users\Nancy\Documents\Visual Studio 2008\Projects\softwaree\softwaree\Form2.cs 53 17 softwaree
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace softwaree
{
public partial class Form2 : Form
{
SqlConnection cn = new SqlConnection("data source=.;database=biblio;uid=admin;pwd=pw");
SqlDataAdapter da = new SqlDataAdapter();
string strSQL = "Select Title, PubID from Titles";
SqlCommand cmd;
SqlDataReader Dr;
System.Windows.Forms.Button Button2 = new System.Windows.Forms.Button();
System.Windows.Forms.ListBox ListBox2 = new System.Windows.Forms.ListBox();
System.Windows.Forms.TextBox TextBox2 = new System.Windows.Forms.TextBox();
public Form2()
{
cmd = new SqlCommand(strSQL, cn);
this.SuspendLayout();
this.Button2.Location = new System.Drawing.Point(136, 248);
this.Button2.Size = new System.Drawing.Size(144, 32);
this.Button2.Text = "Get Data";
this.Button2.Click += new System.EventHandler(this.Button1_Click);
this.ListBox2.Location = new System.Drawing.Point(48, 64);
this.ListBox2.Size = new System.Drawing.Size(312, 160);
this.TextBox2.Location = new System.Drawing.Point(48, 24);
this.TextBox2.Size = new System.Drawing.Size(328, 20);
this.TextBox2.Text = "Hit";
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(408, 293);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.Button2,
this.ListBox2,
this.TextBox2});
this.ResumeLayout(false);
}
[STAThread]
static void Main() {
Application.Run(new Form2());
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
cn.Open();
cmd.CommandText = strSQL + "'" + TextBox1.Text + "%'";
Dr = cmd.ExecuteReader();
ListBox1.Items.Clear();
ListBox1.BeginUpdate();
while (Dr.Read()){
ListBox1.Items.Add(Dr.GetString(0) + " - " + Dr.GetInt32(1).ToString());
}
ListBox1.EndUpdate();
Dr.Close();
}
}
}
|
|
|
|
|
Always rememebr this rule of thumb:
Everyapplication can have one and only one Main function.
Search in your code, it looks that there are multiple main functions are defined.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
This has nothing at all to do with ASP.NET. You want the C# forum. You should work through a basic book rather than trying to copy code off the web.
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.
|
|
|
|
|
I have a dataset in which is data is comming from two table coresponding id
ad = new SqlDataAdapter("select cityid,cityname,stdcode,statename from cities,States where cities.stateid=states.stateid", con.cn);
ad.fill(ds,"Temp");
GridView1.DataSource =ds.Tables["Temp");
GridView1.DataBind();
but Right now I Want to filter dataset according to textbox value Colmun Wise who will enter by user.
we can filter data directly from table but I want to filter data from dataset. give me help or sugesstion. Thnks.....
|
|
|
|
|
|
It is not working. there are more than one textboxes and user can enter value more than one textboxes according to colmuns
|
|
|
|
|
You can change filter expression for Select of dataset as per our values.
|
|
|
|
|
But it is giving error object refrence is no set an instance in secondline while colmun is ok and also creare memory for dataset
DataRow[] R;
R =ds.Tables["tmp"].Select("cityname ='" + TextBox6.Text + "'");//Error
GridView1.DataSource = R;
GridView1.DataBind();
|
|
|
|
|
I think something you did wrong in code.Plz check stack trace and find out whats causing the pblm.
|
|
|
|
|
hai i have one doubt i m using substring in for to display only 10 characters
i m fetching data from database.. column name called description
and now i want to substring of that desciption colunm , write code in c#.
and i wrote code for that like this
lbl_sub.Text = lbl_sub.Text.Substring(0,5-0).ToString() + "..";
this coding working but my problem is when i m fetching .. if there is no data in database ..the n i m getting error. if data lessthan 5 characters then also i m getting error..
plz could u tell me how can i do this ..
try and try untill reach success..
|
|
|
|
|
try this,
if(!string.IsNullOrEmpty(lbl_sub.Text))
{
lbl_sub.Text = (lbl_sub.Text.Length > 5) ? lbl_sub.Text.Substring(0, 5) : lbl_sub.Text;
}
|
|
|
|
|
Thanks dude its working ..thanks a lot ..
do u know how can i change color of that description column data nad disply into different color.
try and try untill reach success..
|
|
|
|
|
|
Rajeshwar Code- Developer wrote: do u know how can i change color of that description column data nad disply into different color.
You are displaying it in a label.right?
Then just give color for label.
|
|
|
|