Data Controls :: Unable To Get Route Data Value

Apr 27, 2016

string query = "SELECT tbl_user.email, myselfprofileClient.clientName, myselfprofileClient.clientImages, myselfprofileClient.CompanyDescription, myselfprofileClient.WebUrl, tbl_user.name,tbl_user.mobileNumber, tbl_user.password, tbl_user.repassword, tbl_user.professions, tbl_user.organisation, tbl_user.webUrl AS Expr1, tbl_user.activated, myselfprofileAddress.MobileNumber AS Expr2, myselfprofileAddress.UserAddress, myselfprofileaboutUs.aboutUs, myselfprofileheader.profile_pic, myselfprofileheader.headerimage, myselfprofileheader.facebookPageLink,

[code]...

There is show error this:

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

View 1 Replies


Similar Messages:

Forms Data Controls :: Unable To Update The Data In Nested Data Lists?

Feb 16, 2011

i am unavble to update the data in nested data lists in asp.net, if any one have the code

View 3 Replies

Forms Data Controls :: Unable To Read Data From Excel File To Gridview?

Mar 4, 2010

I am reading data from Excel file using oledbdataadapter and binding to gridview.Every thing working fine.but if the cell is having some text along with bar sysmol ( | ) [Ex : 12345 | 789123] that cell data is not reading from excel file.All fileds in excel sheet is text format only.Some times it's reading correctly & some times it not reading(empty).Is there any problem with bar symbol ( | )

View 1 Replies

Forms Data Controls :: Unable To Retrieve A Gridview Selected Row Cells Data

Mar 16, 2010

i am still stumped with this operation: i am trying to retrieve a GridView selected row data..here is my code.. the commented part that gives me the selectedindex works just fine....but the one giving the selected row cell value does't work and there is no error.. The update operation is done successfully...weired. i need to assigned selected row cells values to variables ..do some calculations and then re-assign the result calculation to cell[9]..

protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
string s = GridView1.SelectedRow.Cells[5].Text;
TextBox1.Text = s.ToString();
//string s2 = GridView1.SelectedIndex.ToString();
//TextBox1.Text = s2.ToString();
}

View 5 Replies

Forms Data Controls :: Unable To Bind Data Inside Checkbox List

Feb 16, 2010

i m unable to bind data inside checkbox list. this is my code

protected void dlBreeds_ItemDataBound(object sender, DataListItemEventArgs e)
{
try
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
CheckBoxList cbl = e.Item.FindControl("cblAnimaltype") as CheckBoxList;
if (cbl != null)
{
cbl.DataTextField = DataBinder.Eval(e.Item.DataItem, "BGName").ToString();
cbl.DataValueField = DataBinder.Eval(e.Item.DataItem, "ID").ToString();
}
}
}
catch (Exception ex)
{
pnlStatus.Visible = true;
lblMessage.Text = ex.Message.ToString();
}
}
protected void BindAnimals()
{
//*********************************************************************************
// Purpose : To bind breeds in listbox
// Inputs : Nothing
// Returns : Nothing
//*********************************************************************************
DataSet ds = new DataSet();
try
{
ds = InvertebrateProviders.GetBreedsName_Invertebrate(1);
if (ds.IsInitialized)
{
DataView dv = ds.Tables[0].DefaultView;
dv.RowFilter = "ID<>0";
dlBreeds.DataSource = dv;
dlBreeds.DataBind();
}
}
catch(Exception ex)
{
pnlStatus.Visible = true;
lblMessage.Text = ex.Message.ToString();
}
}
<asp:DataList id="dlBreeds" runat="server" DataKeyField="BGName" OnItemDataBound="dlBreeds_ItemDataBound" RepeatDirection="Vertical">
<ItemTemplate>
<asp:Panel ID="pnbBreed" BorderColor="#7f9db9" Height="129px" Width="220px" ScrollBars="Vertical" BorderWidth="1px"
BorderStyle="solid" runat="server" Visible="true">
<asp:CheckBoxList ID="cblAnimaltype" DataTextField='<%#Eval("BGName") %>' DataValueField='<%#Eval("ID") %>' AutoPostBack="True" runat="server" Height="129px" CellPadding="0" CellSpacing="0"
OnSelectedIndexChanged="cblAnimaltype_SelectedIndexChanged" Width="200px" >
</asp:CheckBoxList></asp:Panel>
<asp:CheckBoxList ID="cblBreeds" Height="90px" Width="200px" runat="server" ></asp:CheckBoxList>
</ItemTemplate>
</asp:DataList>

View 5 Replies

Forms Data Controls :: Unable To Add New Rows Of Data To A Database Using The DataGrid Control?

Nov 7, 2010

check the VB behind code for any syntax errors.Unable to add new rows of data to a database using the DataGrid control.Compilation Error message is located at http://cforedu.com:View snap shot images of each line error at http://cforedu.com/snap.pdfThe VB code behind reads (revision 1.3):

[Code]....

View 6 Replies

Forms Data Controls :: Unable To Bind Data To DropDownList In DetailsView

Sep 15, 2010

I have a slight issue I awas trying to fix for 2-3 days, but nothing I try works.

The scenario:

DetailsView control in edit mode, I pass parameters to the SqlDataSourceProducts (edit.aspx?id=2) and the data source selects the appropriate data and fills in the DetailsView form.

Except two drop down lists. These two DDLs (DDL2 and DDL3) are dependent on the previous DDL (DDL1) in the DetailsView.

when the selected value of the DDL1 changes, DDL2 and 3 change their lists and get bound to the database.

The problem is: when I edit something from the database, DDL2 and 3 appear empty and when I update any other field and leave these, they get blanked in the database.

My goal is to set the selected value of DDL2 and 3 to the values in the database WHERE ID = QueryStringField="id".

I can go for not binding the data unless the field is changed, but does not sound professional and user friendly.

code:

The SqlDataSource used to select the parameters from the table and populate the DetailsView

[Code]....

The code of the fields that hold the DDLs in the DetailsView control

[Code]....

The codebehind:

[Code]....

View 10 Replies

Forms Data Controls :: Data Unable To Be Saved In Database When Placed In A Table

Feb 13, 2011

I got a table in a formview where i placed lots of textboxes and dropdownlists inside the table because I need these textboxes and dropdownlists on a background image.

the data on textboxes and dropdownlists that are inside the table is unable to be saved into the database when i pressed the "submit" button. Other textboxes and dropdownlists that are not inside the table work fine. Here are the HTML code for the table:

<asp:Table ID="Table1" runat="server" BackImageUrl="~/images/DRAWING.jpg">

View 9 Replies

Forms Data Controls :: Unable To Update Access Data Source

Jul 19, 2010

Here is the code for my page:

[Code]....

For some reason I seem to be unable to update my DB through the datasource. Is there anything obvious as to why this wouldn't be working?

I even added static values to the update string to see if this works but it still has an issue.

View 1 Replies

Data Controls :: Unable To Insert Data Into Database If There Was Mobile Number?

Jun 6, 2013

I have 2 table in database

1-Estate_free Table

2-Black_list Table

in Register.aspx users can insert their information and when click on insertButton it insert their data into Estate_free table

below is code

  protected void insertButton_Click1(object sender, ImageClickEventArgs e)
{
SqlCommand _cmd = new SqlCommand("InsertFreeState1", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cn.Open();

[Code].....

in above SP I define that if users tell or Mobile number was in Estate_free ro Black_list table it doesn't insert data into database and show 'You can just register 1 Time' and if there wasn't their mobile or Tell in those table it insert their data into Estate_free table and show 'You have been registered'.

problem is that when I enter data in database with new mobile number it didn't insert data in database and show 'you can just register 1 Time'.

I mean it never insert data in database.

what should i do?

View 1 Replies

Forms Data Controls :: Unable To Sort Data-Bound DropDownList When AppendDataBoundItems Is True?

Apr 26, 2010

I'm having a problem sorting a dropdown that I've bound to a SQL Server data source. I've narrowed the problem down to the fact that I have a static item at the top of the dropdown with the data-bound items appended afterwards. If I remove the static item (<asp:ListItem Value="-1" Text="All" />) the ORDER BY part of the select clause works fine. How can I get around this issue? What I would like is to have the "All" static item at the top of the list with the data-bound items sorted alphabetically afterwards. I'm using Visual Studio 2010 and ASP.NET 4 if it makes any difference.

[Code]....

View 1 Replies

Forms Data Controls :: Unable To Export Data To An Excel File In Grid Format

Sep 7, 2010

I'm exporting data to an excel sheet from the ojects list. The data is exporting to excel sheet well, but I'm unable to see the grid format for the data. The data is looking with out the rows and columns lines.I think I'm missing to set some property or somethnig ehwn exporting.

View 6 Replies

Forms Data Controls :: Unable To Cast Object Of Type 'System.Data.Common.DataRecordInternal'?

Jul 7, 2010

Trying to explain this clearly. I have a dropdown listbox where user can select multiple names. These names are then selected/inserted into db table in a loop. Table is displayed in an editable gridview. I have a main sqldatasource1 on my aspx page with select/insert/update permissions, but because select command doesnt work with parameters of multiple values (or does it?), i resorted to using an alternative sql datasource in the codebehind in order to run the select query on the multiple values chosen from the dropdownlist to see if they were in my table.I now get this error when I go to select multiple names from the dropdown list

Unable to cast object of type 'System.Data.Common.DataRecordInternal' to type 'System.Data.DataRowView'.

View 2 Replies

Forms Data Controls :: Unable To Bind Data To Reapeter?

May 15, 2010

I retreive data from database but not able to bind it to a repeater control. this is the error i get.

[Code]....

View 4 Replies

Forms Data Controls :: Unable To Enter Data Into Database

Apr 30, 2010

unable to enter data into database

View 4 Replies

Forms Data Controls :: Unable To See The Table Data Using Placeholder?

Dec 1, 2010

I have the following code, however I am not able to see the table data using placeholder,

The dataset shows the column info but no data. the query shows the data from query builder.

protected void btn_save_click(object sender,
EventArgs e)
{
string host;

[Code]....

View 7 Replies

Forms Data Controls :: Unable To Get The Edited Data From The?

Mar 25, 2010

I have a grid view. I added the edit and save buttons to th grid view. when I click on the edit I am seeing the text boxes and able to edit the data.But when I click on save I was getting the data before edit. How can I get the data i.e. edited ?eg: Before edit If my data is Chris(firstName) burton (lastname) and if click on edit and change the first name to christopher and click on save

in my if(e.commandname=="save")
{
string arg =

[code]...

View 10 Replies

MVC - Add/rewrite Route Data Globally?

Jan 3, 2011

i have quite big ASP.NET MVC 2 application (multiple areas, each with own routing registration) using routes like this :

/Item/12345/Detail - where 12345 is the ID of the item. The whole application just rely on that numeric IDs. But now there is an requirement (seo stuff) to make URLs look like this :

/Item/item-unique-string-name/Detail

I would love to handle this globally in some high level - for example load numeric ID before route evaluation and "replace" it in route data. But i am not sure what is the right spot for such a hack - custom MvcHandler, custom IRouteHandler, somewhere else ?

View 1 Replies

MVC :: Webforms Route / Implementing Route In Global.asax

Mar 13, 2011

I tried to mix asp.net 4 webfrom and ASp.Net MVC 3. I add required lines in webconfig, but I've issues implementing route in global.asax

Currently I use several routes for webfroms. routs template are like below

routes.MapPageRoute("Node", _
"article/sport/{nID}/", _
"~/article/articleview.aspx")

I encounter error, when I add below lines to global.asax

routes.MapRoute( _
"Defaultss", _
"{controller}/{action}/{id}", _
New With {.controller = "Home", .action = "Index", .id = UrlParameter.Optional} _
)

I want to know how could I mix ASp.Net MVC routes with webforms routes.

View 3 Replies

How To Get The Url To The Current Action (after Modifying Some Route Data)

Aug 17, 2010

I'm localising a site via a Change Language control in the master page. I need to render the control with the current url you're on in each of the different languages.

So if you're on http://site.com/en/Home/About and you change the language to french, I need to direct you to http://site.com/fr/Home/About.

The localisation code works on the route data language property, so I've been trying to figure out how I can:

Get access to the current action (with all original parameters) Get the url to the current action (with all original parameters) with the route data changed.

I've tried passing the ViewContext from the parent into the UserControl, which gives me access to the route data but I can't figure out how to get the language routed url from that.

View 2 Replies

Web Forms :: Getting Route Data For .ascx Codebehind?

Mar 12, 2011

[Code]....

works okey in aspx codebehind. However, how can I get the same parameter value from an ascx file codebehind.

View 2 Replies

Web Forms :: Can Access The Route Data From The Destination Page

Sep 8, 2010

Looking at the asp.net v4 URL Routing it's easy to see how to access routing data from basically anywhere in the app.

Via: Page.RouteData.Values["blah"]

Unfortuantely the Route data always is blank by the time i hit the page on my v 3.5 implementation of routing. I was wondering if there was any way to either pass the route values to the final page so i can use them there - i really don't want additional logic in my handler file and i have loads of Routes and don't want many RouteHandlers.

View 3 Replies

MVC :: A Route Named 'Admin_default' Is Already In The Route Collection?

Mar 9, 2010

when i run the app i got this error

A route named 'Admin_default' is already in the route collection. Route names must be unique.
Parameter name: name

this is my AdminAreaRegistration

[Code]....

View 2 Replies

Forms Data Controls :: Gridview SelectedIndex / Unable To Access The Data In The Gridview's Selected Row

Jul 31, 2010

I am unable to access the data in the gridview's selected row. I have done this lots of times but must be forgetting something.

Here is my gridview:

[Code]....
[Code]....
[Code]....

View 4 Replies

Route Constraints And Empty Route?

Sep 24, 2010

I have a url that I want to map routing to:

[URL]

where tabvalue is one of: "personal", "professional", "values" or nothing.

I want to map it to a route like:

Member/Edit/{tab}

But my problem is - I don't know how to specify such constraints. I'm trying this regex:

^[personal|professional|values]{0,1}$

but it only works when I use url

[URL]

[URL]

and doesn't work for

[URL]

how to specify the correct constraint?

P.S. I'm not using MVC, just asp.net WebForms

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved