|
i have to retrieve hidden data from gridview.
hidden data is Usr_No. then i need to update the record based on that condition. now i am getting the hidden data.when i click on update button only first record is updating.when i am trying to update next records error message is showing like Object reference not set to an instance of an object.
my code is
protected void grdCandidate_Update(object sender, GridViewUpdateEventArgs e)
{
try
{
SqlConnection con = new SqlConnection(connStr);
con.Open();
foreach (GridViewRow row in grdCandidate.Rows)
{
int index = e.RowIndex;
int pageindex = grdCandidate.PageIndex;
int pagecount = grdCandidate.PageSize;
int selectedindex = (pageindex) * (pagecount) + index;
DataSet ds2 = (DataSet)ViewState["Data"];
string usr_sno = ds2.Tables[0].Rows[selectedindex]["usr_sno"].ToString();
//string Round_Desg = ((DropDownList)row.FindControl("ddlStatus")).SelectedItem.Value;
string Round_Desg = ((DropDownList)row.FindControl("ddlStatus")).SelectedItem.Value;
Response.Write(Round_Desg);
string sqlUpdate = "update TB_NISI_Interviewdetails set Round_Desg=@Round_Desg where usr_sno=@usr_sno";
SqlCommand cmd = new SqlCommand(sqlUpdate, con);
//cmd.Parameters.AddWithValue("@Company_Name", ddlCompanyName.SelectedItem.Text);
//cmd.Parameters.AddWithValue("@inter_date", txtDate.Text);
cmd.Parameters.AddWithValue("@Round_Desg", Round_Desg);
cmd.Parameters.AddWithValue("@usr_sno", usr_sno);
cmd.ExecuteNonQuery();
con.Close();
BindData();
}
}
catch (Exception ex)
{
string a = ex.ToString();
}
}
plz help me.
|
|
|
|
|
This forum is for article suggestions.
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
Hi all,
I am newbie here.
My Tech. environment: .Net and Sql Server
Problem:
Manyatimes, we need to return data from different tables in the database to the UI (for example, search results) whose schema wouldnt match with any of the domain objects.
In this case, one option is to transfer the data using the datasets/datatables feature provided by .Net.
The other option I could think of is to create business (DTO?) objects to just pass on the data from the DB to the UI.
I prefer the second approach. However, I need suggestions on how do I implement it? Will this DTO contain a reference of all the domain objects involved or Can I just include only the desired columns?
Or, do we have any other solution?
Thanks in advance,
AGL
|
|
|
|
|
Not sure if this suggestion is on the right track but if you use VS2005 then the GetData method of a TableAdapter will return a table object that contains both the data and the table schema from the database. You can use an sql statement to limit/filter the rows too.
|
|
|
|
|
You can create a class with public propertis for the fields which you want to display and make collection of that class by inherit the ArrayList.
Best Regards,
Chetan Patel
|
|
|
|
|
Please can anyone help me with a TimeSheet Control in VB.NET 1.1..
A sample source would help.
Thanks in Advance,
Sachin G.
Spectrum Info Solutions
|
|
|
|
|
This forum is for article ideas.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I have a number of signals received by the same capsule. I'm wondering if someone knows an elegant way to represent this on a sequence diagram? I'm using UML 1.3 and considering upgrading to 2.0, if necessary.
jD
|
|
|
|
|
Cud somebody tell me how can i find the message being displayed in the status bar of a web page using Javascript,html, css and if it resulted in opeing of any link on the web page
MARTAND SHARDUL
|
|
|
|
|
defaultStatus and Status are the properties you are looking for with javascript, and i'm not sure what you mean by the last part.
|
|
|
|
|
Hello frnds!!
well I wanted to confirm that whether Google allows us to create tools(Adsense TOOls) and is it possible without due permiossion from GOOGlE
MARTAND SHARDUL
|
|
|
|
|
PLz somebody reply
MARTAND SHARDUL
|
|
|
|
|
Martand S wrote: PLz somebody reply
Maybe no body knows the answer. If someone does and they come along, they may answer it for you. But don't get rude or pushy about needing someone to reply quickly. It does not work like that around here Have you looked around google and their tools?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
It is users.sql :
use NHibernate
go
CREATE TABLE users (
LogonID nvarchar(20) NOT NULL default '0',
Name nvarchar(40) default NULL,
Password nvarchar(20) default NULL,
EmailAddress nvarchar(40) default NULL,
LastLogon datetime default NULL,
PRIMARY KEY (LogonID)
)
go
It is users.cs :
using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using NHibernate.Cfg;
namespace NHibernate.Examples.QuickStart
{
public class User
{
private string id;
private string userName;
private string password;
private string emailAddress;
private DateTime lastLogon;
public User()
{
}
public string Id
{
get { return id; }
set { id = value; }
}
public string UserName
{
get { return userName; }
set { userName = value; }
}
public string Password
{
get { return password; }
set { password = value; }
}
public string EmailAddress
{
get { return emailAddress; }
set { emailAddress = value; }
}
public DateTime LastLogon
{
get { return lastLogon; }
set { lastLogon = value; }
}
}
//interface ISession
//{
// void save(users newUser);
// void Save(users newUser);
//}
}
It is User.hbm.xml :
using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using NHibernate.Cfg;
namespace NHibernate.Examples.QuickStart
{
public class User
{
private string id;
private string userName;
private string password;
private string emailAddress;
private DateTime lastLogon;
public User()
{
}
public string Id
{
get { return id; }
set { id = value; }
}
public string UserName
{
get { return userName; }
set { userName = value; }
}
public string Password
{
get { return password; }
set { password = value; }
}
public string EmailAddress
{
get { return emailAddress; }
set { emailAddress = value; }
}
public DateTime LastLogon
{
get { return lastLogon; }
set { lastLogon = value; }
}
}
//interface ISession
//{
// void save(users newUser);
// void Save(users newUser);
//}
}
It is App.config :
<configuration>
<configsections>
<nhibernate>
<add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider">
<add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2005Dialect">
<add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver">
<add key="hibernate.connection.connection_string" value="Data Source=dev2;Initial Catalog=NHibernate;User ID=sa;Password=buyagift;">
It is Programs.cs :
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace NHibernate
{
static class Program
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// Application.Run(new NHibernate.Form1());
Application.Run(new NHibernate.Examples.QuickStart.Form1());
}
}
}
This code generates following error:
Unknown entity class: NHibernate.Examples.QuickStart.User
Can anyone help me please?
Thanks
shoaib
|
|
|
|
|
You may want to ask in the SQL forum.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Please stick the format that flows in this Community
1) Don't post kilometers of code.
2) Use code wrappers around the code for better visibility.
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
I am not a programmer, but I need to include Paypal's ADD BUTTON and VIEW CART BUTTON in gridview that reads from an Access Database for online store.
Anyone have any code to share along these lines?
Thanks
James
|
|
|
|
|
|
Yes, I have, but it does not solve my problem. I can do what is being done in this article, which requires manual coding, unless I'm not reading it right. I will give it a closer look.
Thanks.
|
|
|
|
|
wats the cause & how to remove Auto Play option when we click on Ikons of HDD
|
|
|
|
|
WHAT?? It sounds like you have a file in the root of the drive called "Autorun.inf". Kill it.
|
|
|
|
|
Don't tell me. Tell the OP. That way, he'll get a notice that you replied to his message.
|
|
|
|
|
Oops clicked somebody else's Reply
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
Beware this is also the work of the virus w32.Fujacks.K. See if u have a hidden file Desktop_.ini in all folders u have. It will contain the timestamp of the time it was created. IF so please use some good Antivirus viz. McAfee.
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
I have installed oracle 9i in my system. After installation is over,i am unable to login with scott/tiger login. It gives me ORA-12154 error.. Could anyone please help in solving this problem and use oracle..
Thanks in advance,
Umashanker.K
|
|
|
|