Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

BORN again

@BORN again
About
Posts
45
Topics
24
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • link multiple stored procedures to one gridview
    B BORN again

    Hi Christian, Thanks a lot for your time in reading my post and replying to it. I'm still struggling with populating the header of the gridview from the table. My table structure is : ____________________ PhaseId PhaseName ____________________ 1 Scope Closure 2 Functional Design 3 Techical Design 4 Alpha Testing 5 Beta Testing 6 UAT In the header of the gridview I need: =================================================================================================== TemplateHeader1 | TemplateHeader2 | Scope Closure | Func. Design | Tech Design | Alpha | Beta | UAT ==================================================================================================== TeamplateHeader1 & TemplateHeader2 are template columns for checkbox and label. Scope Closure onwards come from the table. Also, The colors for the cells from 'scope Closure' to 'UAT' have to come from the PhaseColor table depending upon the status of phase e.g. AtRisk=Red color, OnTrack=green color etc... first two Template columns and their cells have to stay white or whatever the grids background color is. Is gridview right for such functionality?or is there another alternative to it? In classic ASP the previous person has used elements to achieve the desired result. Thanks for your help once again.

    Aartee. ...HE is watching Us All!

    ASP.NET csharp css asp-net database tutorial

  • link multiple stored procedures to one gridview
    B BORN again

    Hi, I have a gridview for scheduling releases of hotfixes and software plugins.I need to use 3 different stored procedures: 1.a stored procedure to populate the Header of the Grid. The heading names come from a table 2.Another stored procedure to set the background colors of the cells of the gridview (Red,green, amber) based on the status of a project. This data i.e. color names (e.g. #FFFFFF, #BB00CC etc..) are stored in a table and are to be used based on project status which is stored in another table and joined with a foreign key constraint. 3.I need a third procedure that displays the values, i.e. release Dates in each cell based on a few select statements, where clauses and parameters. Can someone kindly guide me a way to achieve this? the project was developed in Classic ASP and needs to redeveloped in ASP.net2.0 Thanks in advance, Aartee. ...HE is watching Us All!

    ASP.NET csharp css asp-net database tutorial

  • Allow to Check only one checkbox at a time in the datagrid
    B BORN again

    Hello, I have a databound datagrid with vehicle driver details. I add new/blank rows to this datagrid on a button click event to insert new record to the driver table and also have the edit/update functionality. One of the columns is 'Current Driver?' which is also databound in a template column. Since there can be only one current driver for a vehicle at a given point of time, on checking the 'current driver' checkbox I need to write an itemdatabound event for the datagrid which will allow me to check only one checkbox. I do not want any messages to popup, all I want is if a person checks this checkbox for a record then it should be allowed but previously checked checkbox for any other records should be unchecked automatically so that any given point only record has the 'current driver' status checked. Is there any way to achieve this? I use VS2005Pro/.net2.0/VB Thanks a ton.

    Aartee. ...HE is watching Us All!

    ASP.NET csharp question announcement

  • cannot add a blank row to a bound datagrid with checkbox control [modified]
    B BORN again

    Thanks MArk, it has worked finally, you were thinking right, just that I had to use 'Is System.DBNull.Value' in place of '==' or '='. Thanks a ton for your solution, it worked like magic.

    Aartee. ...HE is watching Us All!

    ASP.NET help question sysadmin docker announcement

  • cannot add a blank row to a bound datagrid with checkbox control [modified]
    B BORN again

    Hi Mark, Thanks once again for your help. I tried to change the code as per your suggestion above but now I am getting error : BC30691: 'DBNull' is a type in 'System' and cannot be used as an expression. any ideas? Thanks.

    Aartee. ...HE is watching Us All!

    ASP.NET help question sysadmin docker announcement

  • cannot add a blank row to a bound datagrid with checkbox control [modified]
    B BORN again

    Hello Mark, A big thankyou for your prompt help and your time to read my post. I jumped to the solution and did a copy-paste (VB code), but I get the following error : Compiler Error Message: BC30201: Expression expected. Source Error: asp:templatecolumn headertext="Current Driver?"> itemtemplate> asp:checkbox id="cbcurrentdriver" runat="server" autopostback="true" checked='<%# Iif(DataBinder.Eval(Container.DataItem,"currentdriver")== System.DBNull, false, DataBinder.Eval(Container.DataItem,"currentdriver")) %>' enabled="false" /> /itemtemplate> what am I doing wrong?

    Aartee. ...HE is watching Us All!

    ASP.NET help question sysadmin docker announcement

  • cannot add a blank row to a bound datagrid with checkbox control [modified]
    B BORN again

    Hello, I think I am posting this question again but I'm quite frustrated as I haven't found any way around. I have a databound datagrid in which New/Blank rows are added to this datagrid on a button click event. This button is outside the datagrid and not in the footer. The datagrid populates well and I can do the edit/update to the already created records. I recently had to add a new checkbox field to my data table. This chekcbox field is to be included in this datagrid. The chkbox works fine for previously created records but as soon as I hit the 'Add New Row' button I get the following error : Exception Details: System.InvalidCastException: Conversion from type 'DBNull' to type 'Boolean' is not valid. Source Error: asp:checkbox id="cbcurrentdriver" runat="server" autopostback="true" enabled ="false" checked='<%# DataBinder.Eval(Container.DataItem,"currentdriver") %>' /> My code for adding a new/blank row (on button click event) is as below: RefreshGrid() Dim ds as DataSet = DataGrid.datasource Dim blank as DataRow = ds.tables(0).NewRow() ds.tables(0).Rows.insertAt(blank, ds.tables(0).Rows.Count) DataGrid.EditItemIndex = ds.tables(0).Rows.Count-1 DataGrid.DataBind() and my checkbox template column is as below: asp:templatecolumn headertext="Current Driver?"> itemTemplate> asp:checkbox id="cbcurrentdriver" runat="server" autopostback="true" enabled ="false" checked='<%# DataBinder.Eval(Container.DataItem,"currentdriver") %>' /> I really am clueless on this one. everything seems fine. Nulls are allowed on this field in my datatable.Please help! Thanks. -- modified at 23:58 Monday 26th February, 2007

    Aartee. ...HE is watching Us All!

    ASP.NET help question sysadmin docker announcement

  • Add a Blank Row to Gridview?
    B BORN again

    Hello, Does anyone have a code snippet for adding a blank row at the end or top of the gridview on a button click?The button is outside the GV and not in the footer. I did it in datagrid and I guess it was easier.But for gridview it isn't working. I will post my little snippet but it is giving me error: Protected Sub btnadddriver_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnadddriver.Click DriverGV.DataBind() Dim ds As DataSet = DriverGV.DataSource Dim blank As System.Data.DataRow = ds.Tables(0).NewRow() ds.Tables(0).Rows.InsertAt(blank, ds.Tables(0).Rows.Count) DriverGV.EditIndex = ds.Tables(0).Rows.Count - 1 DriverGV.DataBind() End Sub The error I am getting is : Exception Details: System.NullReferenceException: Object reference not set to an instance of an object Line 16: Dim blank As System.Data.DataRow = ds.Tables(0).NewRow() If someone has a working snippet for adding a blank row to the gridview can you kindly help me? I'm on Visual Studio2005,Asp.Net2.0,VB Thanks.All help is much appreciated.

    Aartee. ...HE is watching Us All!

    ASP.NET help csharp asp-net question

  • Arithmetic Overflow etc...Error for datetime in gridview
    B BORN again

    Smiles to all, We are moving from Datagrid to gridview in one of the applications and the gridview is linked to a datasource with Select Command as below ... SELECT DriverNo, RegNo, DriverName,projectcode,Convert(datetime,startdate,103) as StartDate, Convert(Datetime,enddate,103) as EndDate, OdoReading, currentdriver FROM DriverDetails where regno=@regno and Update Command as ... UPDATE DriverDetails SET DriverName = @drivername, StartDate = @startdate, EndDate = @enddate, OdoReading = @odoreading, projectcode = @projectcode, currentdriver = @currentdriver WHERE (DriverNo = @driverno) My dates (startdate & enddate) are in the dd/mm/yyyy format(I'm in Australia) and I already have more than 500 records created with date stored in above format. The gridview populates fine but when I try to update the values I get the following error: Arithmetic overflow error converting expression to data type datetime. The statement has been terminated. I know it is the date format but don't how to fix it in the update command. if I type the date as 20/01/2006(dd/mm/yyyy) it fails but if I type the date as 01/20/2006(mm/dd/yyyy) it works. But the users want it as dd/mm/yyyy plus it is impossible to change date formats for previous records. There is no code-behind. I am doing update on UpdateCommand of my datasource so please suggest how to modify the update command to convert dates. Thanks.

    Aartee. ...HE is watching Us All!

    ASP.NET help tutorial announcement

  • Web.Config error
    B BORN again

    Hi OBarahmeh, I have had this error once in the recent past, from my experience regarding this error I would say that you haven't created a 'Virtual Directory' for your application in the IIS server. applications always run locally even if VD is not created but you will have to create a VD for the appln to run on your server. Go to: IIS Manager-->yourserevr(localcomputer)-->WebSites-->defaultWebsites-->Rightclick YourApplication --> Properties-->Create I am sure you know this(path) already, but I included just-in-case... Good Luck.

    Aartee. ...HE is watching Us All!

    ASP.NET help asp-net csharp dotnet sysadmin

  • HyperLink in GridView
    B BORN again

    Hi MD_Nada, Can you post your navigationURL that you are passing in the hyperlink? In the meantime: You can send your rowindex id in the URL string itself. For eg: you want to access myhyperlinkpage.aspx your URL string will be - http://xyz/myhyperlinkpage.aspx?id={0} , this will pass the id or the rowindex of that row. Also, do not forget to add your id or primary key of your table in the 'DataKeyNames' property of your gridview. If this explanation is not too clear, kindly post your URL.

    Aartee. ...HE is watching Us All!

    ASP.NET question help

  • Insert statement Conflict in the GridView
    B BORN again

    Hi Apurva, Thankyou for your prompt reply. In my gridview the values are coming from CBValues table & CbNo is ID of that table and foreign key of my master (profitlossdata) table. I am populating my gridview with CBNo and some other template columns. Then I am trying to insert these values into my master table on a button click event as in the sub in my previous post, so these values will exist in master table only if the Insert statement works, and that is my problem, the insert stt is failing... or am I confused?...well it's 3:30pm in Adelaide :) I guess my brain is off for a nap. Can you kindly explain it a bit more in detail? Thanks a million.

    Aartee. ...HE is watching Us All!

    ASP.NET question database help tutorial

  • Insert statement Conflict in the GridView
    B BORN again

    Hello & smiles, Can someone kindly guide as to what is going wrong in my Sub below? I am getting the error as : System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_ProfitLossData_CBValues". The conflict occurred in database "ProfitLossRegister", table "dbo.CBValues", column 'cbno'. The statement has been terminated. ------------------------------------------------------------------------------------------ Protected Sub btnsave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsave.Click Dim connectionsave = New SqlConnection(ConnectionString) Dim Commandsave As SqlCommand Dim forecastbox As String Dim commentbox As String Dim catvalue As String Dim CBVal As String Dim PLGridRow As GridViewRow Commandsave = New SqlCommand Commandsave.Connection = connectionsave Try connectionsave.open() 'iterate through all the gridrows For Each PLGridRow In PLForecastGrid.Rows forecastbox = CType(PLGridRow.FindControl("txtforecastbdgt"), TextBox).Text commentbox = CType(PLGridRow.FindControl("txtcomments"), TextBox).Text catvalue = PLGridRow.Cells(0).Text lbltest1.Text = catvalue CBVal = PLGridRow.Cells(1).Text lbltest2.Text = CBVal Commandsave.CommandText = " Insert into profitlossdata" Commandsave.CommandText += " (forecastbdgt,comments,branchno,yearno," Commandsave.CommandText += " bpno,catno,cbno)" Commandsave.CommandText += " Values ('" & forecastbox & "', " Commandsave.CommandText += "'" & commentbox & "', " Commandsave.CommandText += "'" & lblbrvalue.Text & "', " Commandsave.CommandText += "'" & lblyrvalue.Text & "', " Commandsave.CommandText += "'" & lblbpvalue.Text & "', " Commandsave.CommandText += "'" & lbltest1.Text & "', " Commandsave.CommandText += "'" & lbltest2.Text & "')" Commandsave.ExecuteNonQuery() Next lblmessage.Text = " Records Created!" Catch ex As Exception lblmessage.Text = ex.ToString Finally connectionsave.close() End Try End Sub -------------------------------------------------------------------------------------

    ASP.NET question database help tutorial

  • Checkbox in Datagrid failing on Add New Row
    B BORN again

    Hello Kinnu, Thankyou for your reply. I did try giving it a default value 'F' with 7 without quotes, I even tried default value false and NULL but it didn't work and SQL database is giving me an error when I type the default value as: Error validating the default value for column 'currentdriver'. It does not give me this error when I enter default value as NULL or 0 but my program is still not working and giving me the same conversion (DBNULL to Boolean) error. Thanks once again. Please let me know if you have any other tips or suggestions.

    Aartee. ...HE is watching Us All!

    ASP.NET database help data-structures debugging announcement

  • Checkbox in Datagrid failing on Add New Row
    B BORN again

    Hello & Smiles, I had to add a new field to one of my old projects which was designed using Datagrid, it is a checkbox field with datatype as 'Bit'(SQL 2005)same as boolean. I added the checkbox in datagrid as below: In the Insert and Update Sub's I added the code as below: Dim chkbox As CheckBox = CType(e.Item.Cells(9).FindControl("cbcurrentdriver"), CheckBox) If chkbox.Checked = True Then Command.Parameters.Add("@currentdriver", SqlDbType.Bit, 2).Value = "True" Else Command.Parameters.Add("@currentdriver", SqlDbType.Bit, 2).Value = "False" End If Also, included the field in Databind for Datagrid with select * from etc... This works fine when I open the page in update mode and shows the status of checkbox as checked or unchecked depending upon it's value in database. My datagrid has a feature 'Add New row' which blank row and this part fails giving me the error - Conversion from type 'DBNull' to type 'Boolean' is not valid. 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.InvalidCastException: Conversion from type 'DBNull' to type 'Boolean' is not valid. Source Error: Line 1175: Line 1176: Line 1177: Line 1178: I have been struggling with Null checks for checkboxes etc... for last two days. Any help is Gratifying. Thankyou. Aartee. ...HE is watching Us All!

    ASP.NET database help data-structures debugging announcement

  • Pop-Up Word document fromt the GridView Hyperlink/Template column
    B BORN again

    Hello, I have a gridview as below: CategoryNo | Category | CurrentValue | ForeCastValue | HelpFiles | Comments I already have pre-defined values for 'Category' & obviously 'Category No' (which is auto & PK). These values are displayed when gridview opens. 'CurrentValue','ForecastValue' & 'Comments' are template fields with textbox controls. For the 'Help Files' column I have pre-designed Word documents for each Category. I need to display an image in the Help column and link the Respective Word Documents for Each Category. In the past, in one of the other projects I have created a 'Details' page and linked it to the Hyperlink column with an image and opened it in the popoup window with 'javascript:window.open(details.aspx?id={0})' etc... But here I am a bit lost as to how go about opening word documents for each category as a 'pop-up' help file with an image. I have created a 'Text' data type in the 'Category' Table in Sql Server 2005. In this field as of now I am saving the physical path of the word document for each category again catno. Should I use a Template field with 'DataBind.Eval' or still use hyperlink column to display the link and image? Using : ASP.Net 2.0, VS2005, VB, SQL Server2005 Any help is much appreciated. Thank you.

    Aartee. ...HE is watching Us All!

    ASP.NET csharp javascript asp-net database sql-server

  • Recalculating values in a datagrid with values fom textbox
    B BORN again

    Hi Pratibha, Thankyou for your Reply.Yes the datagrid is connected to the database. so as per your solution it also means I will need to introduce EOMRate as a new field in the datatable right? or maybe I don't need to and then I can calculate the buyamt and sellamt in the code behind the 'Calculate' button and call Refreshgrid() which will display the new values. So I do not really need to touch the datagrid(geeee that's great!) well, it does sound quite straightforward...I will go ahead with this solution and see how it works. Thanks a lot. Aartee. ...HE is watching Us All!

    Visual Basic database help question

  • Recalculating values in a datagrid with values fom textbox
    B BORN again

    Hello, I have a datagrid which is databound.Users enter the data into the webform which is saved into the database and this data is later retrieved and viewed in a Datagrid. As of now about 200 records have been created and they are all visible in the datagrid. The next step is that on the datagrid page, there is a textbox to enter monthly exchange rate on the top of the page i.e. outside the datagrid, users will enter a value in this textbox and based on that value 3 columns in the datagrid need to be recalculated. eg: enter EOMRate: ____________ (this is a textbox) | V This is the datagrid ____________________________________________________ regno buyamt sellamt bankname SpotRate Range ____________________________________________________ 1 20000 30000 DBAL 0.65 Within Range 2 3 -- -- 200 _________________________________________________________ Once the EOM rate is entered in the textbox then buyamt and sellamt will be recalculated in the datagrid for all 200 records. Is it possible to achieve this?Any help, guidelines? Thankyou very much for kindly sparing your time to read this post and help me solve it. Aartee. ...HE is watching Us All!

    Visual Basic database help question

  • Validation for Dropdown list
    B BORN again

    I am using a 'Required Field Validator' for my Dropdown list but it doesn't work , if I do not select any thing from the list it still saves the form and I guess that is necause it assmues the first entry in the list as selected always no matter what the first item is. I also tried using 'Range Validator' to see that the item selected from the dropdown is between 2 & 10... item no 1 in the dropdown is 'Please Select' , but that is not working as well.. does anyone have an idea as to which validator will work to see that the user HAS selected an entry from the dropdown else the form will not save. Thank you for your precious time invested in answering this query. Aartee. ...HE is watching Us All!

    Visual Basic database

  • searching AND paging?
    B BORN again

    I have a datagrid in which I have 'Paging' functionality of type numeric (pages 1 to 10....) and also a search functionality wherein the user enters say name or branchname or recordno in the text box and the datagrid searches the desired record/s. My problem is the 'search' functionality works only the first page (or parent page) of the datagrid but when I am on say page no 2 or 4 or 10 etc... it doesn't work it comes with the following error: System.Web.HttpException: Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount. My code for paging is as follows: '*********************************************************************** Sub DataGrid_PageChanger(Source As Object, E As DataGridPageChangedEventArgs) ' Set the CurrentPageIndex before binding the grid DataGrid.CurrentPageIndex = E.NewPageIndex Refreshgrid(Cint(ddlBranch.SelectedItem.Value),txtsearch.text) End Sub '*********************************************************************** Any suggestions? Thanks a ton!!! Aartee. ...HE is watching Us All!

    Visual Basic help css wpf wcf algorithms
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups