|
Thanks for the reply, The FormID is bound because that is the PK that I don't want the user to see, but when the row is selected then I use FormID to lookup data so I can populate a panel with record details. Even when it is visible I still have the same problems. oGrid.SelectedIndex and SelectedRow are behaving as expected.
|
|
|
|
|
that is why you can use the DataKeyNames to store your PK in. So not visiblle but accessible and no columns to hide. If you set the selectedIndex value, the property SelectedValue will contain the PK value.
ShowIncidentDetails(CType(oRow.Cells(0).Text, Integer))
isn't cells[0] now formtype in stead of formID?
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
I can use DataKeyNames which is nice to know but unfortunately it doesnt solve the problem
Also, even if I set visible=false on the first column the data is still bound as index 0 so cells[0] returns the formid as expected.
|
|
|
|
|
Hi,
I've realized an APS.NEt application that used a SQLServer DB. It is just installed and it works fine.
The same application is installed on a Virtual Machine ( S.O. Windows Server 2003 + IIS 6.0 . Here, for each postback tha application crashes and says that it has failed to load view state.
I've tryed also to built the application on the VM with visual studio and then reinstalled the application but the problem persists.
The View State problem exists also in DebugMode on VisualStudio. All these problems only on Virtual machine. What could be the mistake?
Thanks in advance for eachone who will help me.
|
|
|
|
|
What is the precise error message ? Is it a security related message ? If the framework thinks that viewstate has been changed, a crash is the default behaviour, but this can be fixed by changing the web.config.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
The error is the class View State error:
"Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request."
You say that a possible solution is to change the web.config...how would you change it?
|
|
|
|
|
No, that's a different error to the one I was thinking of. Have you googled the exact error text ? That's the best way to find solutions to issues like this.
Are you adding controls dynamically ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Yeah, I've googled for two days.
In the application I add controls dynamically, but how I've wrote, the problem is only on the Virtual machine.
Instead, whene the application works in the intranet, there is not any problem.
So I don't think that the error is in the code, but rather in the system configuration (IIS, web.Config or other )
|
|
|
|
|
So you're using IIS on the intranet and it works ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
|
Hi,
when i am in first tab, i click edit button in first tab then i go to second tab then i return back to the first tab means it should be in view mode. But instead of this it is in edit mode itself. how can i change from edit mode to view mode while tab click event.
|
|
|
|
|
Don't ask the same thing over and over. Answer is unchanged. When the tab change event occurs, you need to write code to leave edit mode.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
hi
i m using asp.net c# and in backend sql server 2000
i have a web form i m able to save single row in table using asp web page,i want to save multiple row on single click in a single table,i m new in asp.net
pls help me
thanks in advance
|
|
|
|
|
prateekfgiet wrote: ,i m new in asp.net
Then your task is kind of insane. Start slower. Learn how to lay out an ASP.NET project before worrying about databases. If you're new, I assume you're not doing paid work, or school work. If you were being paid, that would be immoral, basically theft. If it was for school, your tasks would be laid out more logically and you'd have spoken to your teacher. So, if you're teaching yourself, start simpler and build up to this task.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
i am in job as a fresher and i have to complete this in any condition so pls help
|
|
|
|
|
OK, so you ARE being asked to steal from a client ? Shame on you, and the people who hired you.
However, people like you are the reason that outsourcing will die over time, and in the meantime, why the only clients it attracts, are idiots.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi Prateek,
Create a XML string and use that XML string to insert values into table ,
(U have to do some googling to check building XML string and insert into DataBase table)
|
|
|
|
|
hey i have a solution!!!!!!!!
Just save the values in Temporary datatable and after that run that temporary datatable in a loop and write the insert in it.....
private void SaveGridDataInTempTable()
{
DataTable dtTemp = new DataTable();
if (dtTemp == null || dtTemp.Columns.Count <= 0)
{
dtTemp.Columns.Add("sino");
dtTemp.Columns.Add("name", typeof(String));
dtTemp.Columns.Add("gender", typeof(String));
dtTemp.Columns.Add("qualification", typeof(String));
dtTemp.PrimaryKey = new DataColumn[] { dtTemp.Columns["sino"] };
}
foreach (GridViewRow gvRow in GridView1.Rows)
{
DataRow drTemp = dtTemp.NewRow();
drTemp["sino"] = int.Parse(GridView1.DataKeys[gvRow.RowIndex]["sino"].ToString());
drTemp["name"] = ((TextBox)gvRow.FindControl("TextBox1")).Text.Trim();
drTemp["gender"] = ((RadioButtonList)gvRow.FindControl("RadioButtonList1")).SelectedValue.ToString();
drTemp["qualification"] = ((DropDownList)gvRow.FindControl("DropDownList1")).SelectedValue.ToString();
dtTemp.Rows.Add(drTemp);
}
Temp = dtTemp;
}
//Property to maintain the Datatable
public DataTable Temp
{
get
{
object o = ViewState["Temp"];
if (o == null)
{
DataTable dt = new DataTable();
return dt;
}
else
return (DataTable)o;
}
set
{
ViewState["Temp"] = value;
}
}
After this your normal insert code,
for(int i=0;i
|
|
|
|
|
Hi ,
I am developing an application with a datagrid using which user can update the data in the datagrid row. Its all in ASP.Net c#.
on click of a button i should do the following.
Check if user has modified atleast one row.
1. If the user has not modified even one row, then i should display a messsage stating user to action atleast one row.--- I have done this check and works good.
2. If the user has changed atleast one row then i should display a alert asking for confirmation if they would like to proceed. If the user selects 'No' i should stop the execution. if he clicks Yes the execution should proceed. -- I need help on this .. I am not able to trigger it becuase the button is already clicked.
Please help me sort the point 2.
|
|
|
|
|
A button click with a server control can have two events, OnClientClick and OnClick. OnClientClick will call a javascript method, which needs to return true for OnClick to be called on the server. So, make your onClientClick show a message box and return true or false, based on what the user clicks.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi Ramkithepower,
Cud u please tell me where is the button located.
with in the Datagrid or outside the datagrid on the form.
Regards,
_Anil
jhgdgf
|
|
|
|
|
i want to open another datagrid on the click button of first datagrid
|
|
|
|
|
do you want to open the datagrid in another page or ...?
Jack Sparrow
--------------------------------------
Defeat is not the worst of failures. Not to have tried is the true failure.
|
|
|
|
|
no i want to open in the same page
|
|
|
|
|
Do you mean nested, or further down the page ? If you want to open number 2 based on what number 1 selects, then you need to use AJAX. If you want them nested, you probably need to use repeaters to lay out your controls.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|