Question about Computers & Internet
How to insert the data in the database from a .net application. i'm using c# as code behind language n getting problems while inserting text fields,number fields are getting inserted without any problem.
Please help me.
Thanks in advance.
You probably need to be inserting the value of a text object (ie, a String) , not the object itself. In VB.NET, a String object is an actual, not unlike a Java String object. In "classic" VB, a String object isn't really handled by the interpreter as an object in the C# / Java sense, so it can be referred to directly without resolving the value via a method call. So attempting to insert an object reference into a database field from C# code will probably not work unless the database knows to call toSting() on the object, which I am 99.99999% sure it cannot (depends on the database-- in this case Access, and more particularly, what version you are using, and if there is any .NET framework interoperability).
Calling myString.toString() though returns a String object in C#, so using that is likely not going to work. What you may need to do is return a character array using the 'chars' and 'length' properties of the C# String object.
Finally, after all this, your problem could be a lot simpler: the value(s) you are trying to insert may not be right for the field-- check the length of the values being inserted, etc. Use .trim() to eliminate leading and trailing whitespace, for example. If you post your INSERT statement and an example of the data you are using, I may be able to tell you more. Also, you are in ASP.NET and data transfer from web containers to Access databases is notoriously bedeviled work.
Posted on Mar 07, 2008
a 6ya expert can help you resolve that issue over the phone in a minute or two.
Best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of.(from cars to computers, handyman, and even drones)
click here to download the app (for users in the US for now) and get all the help you need.
Posted on Jan 02, 2017
Tips for a great answer:
May 06, 2014 | Microsoft Database Software A5K-02817 SQL...
Jun 02, 2010 | Microsoft ASP.NET Programming with MS...
May 31, 2010 | Microsoft ASP.NET Programming with MS...
Mar 09, 2010 | Microsoft Office Standard for PC
Oct 15, 2009 | Microsoft Designing ASP.NET Applications...
Sep 21, 2009 | Microsoft Office Standard for PC
Mar 09, 2009 | Microsoft Press MS Access 2000 and Visual...
Dec 21, 2008 | Microsoft ASP NET WEB MATRIX (583797)
Oct 18, 2008 | Microsoft Office 2003 Basic Edition...
207 people viewed this question
Usually answered in minutes!