473,396 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problems Binding GridView with LINQ

1
Hi, I'm using Linq to bind a gridview and when I debug I get this exception:
"Input string was not in a correct format."
this function loads with the Form
Expand|Select|Wrap|Line Numbers
  1.  
  2. private void DGVWCcode_Changed()
  3.         {
  4.             SalaryDClassesDataContext dc = new SalaryDClassesDataContext();
  5.             BindingSource bs = new BindingSource();
  6.             var wcmpnnts = from c in dc.Wage_Components
  7.                            where c.EmployerID == int.Parse(tbEmplyrId.Text)
  8.  
  9.                   select new
  10.                   {
  11.                     ComponentCode = c.cmpnntCode,
  12.                     ComponentDiscrition= c.cmnntDscrpt,
  13.           };
  14.  
  15.             DGVWCcodes.DataMember = null;
  16.             bs.DataSource= wcmpnnts;/****here I get the exception***/
  17.             DGVWCcodes.DataSource = bs;
  18.         }
is it because my DBis Still empty and can't get null cells?
if not can you tell me what the problem is?
Sep 21 '10 #1
0 861

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Wendy Elizabeth | last post by:
When I am using Visual Studio.net in the debug mode, I want to be able to increase the size of values that can be displayed. For example when using the "watch" or other debug windows, I know I want...
4
by: Hans Merkl | last post by:
Hi, Is there a way to show the column headers of a GridView control even if there is no data? The only thing I see is the EmptyDataTemplate but I would also like to display the column headers. ...
5
by: Joris Zwaenepoel | last post by:
Hi all, I don't think a solution exists, but maybe there is some option in Visual Studio that I do not know about. When developping (or debugging), I like to set the "exceptions" option to...
4
by: Lacutas | last post by:
Hi all, I am having some problems using LINQ to access Distinct records from a Dataset. I have looked around and believe it should be as simple as added .Distinct() to my LINQ query below, though...
2
by: nasayoo | last post by:
I am doing my project using LINQ to SQL technology for the database part. I wrote the coding for inserting a new record into the table. The coding was ok. Its working 100%. But after inserting the...
7
by: shapper | last post by:
Hello, Is it possible to multiply all Prices in a List<Productby 1.1 using Linq? Product has a property named Price. Thanks, Miguel
2
by: Big Daddy | last post by:
For example, if I have a DB table called DownloadPoints with a column named DownloadPointNo, then SqlMetal will create a file with a class called DownloadPoints with an accessor named...
0
by: Big Daddy | last post by:
I am trying to do all my DB access through LINQ. For example, I am trying to delete a record from the JobQueue table. There’s a couple ways I could do this: 1. Method 1 – The disadvantage is...
1
by: nadavgg | last post by:
Hi, I have recently developed a C# application using Linq. I am getting from an external database a list of profiles I need to process, some are new and some are already in the database, and need to...
1
by: fsalido | last post by:
How can i point to record in GridView when i click the button to search for lastname? Im using OLEDB AND VISUAL BASIC 2008. thanks!
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.