C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Insert values


Posted Date: 04 Nov 2009      Posted By: net      Member Level: Silver     Points: 1   Responses: 5



hi,
i am doing project in asp.net with c# in windows applications with backend ms access for that i am using class file like this


for this my class file connection is:

public void SetDB(string Commt)
{

OleDbConnection ConnObj = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\Finance.mdb");
OleDbCommand CommtObj = new OleDbCommand(Commt, ConnObj);
if (ConnObj.State == ConnectionState.Closed)
{
ConnObj.Open();
}
CommtObj.ExecuteNonQuery();
ConnObj.Close();
}

my query is like this:

string s11 = "Insert into LenderesReceivable(InitialAmount,NoOfDays)values('" + txt_amount.Text + "','" + txtnodays.Text + "')";
con.setdb(s11);

while i am entering like con.setdb(s11) this connection is not take and come whether it is correct or wrong





Responses

Author: Praveen    04 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

hi,

what error you are facing?



Author: Deepika Haridas    04 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Your requirement is not clear. Please be specific in your question.



Thanks & Regards,
Deepika
Editor

If U want to shine like a SUN..First U have to burn like the SUN!!
Need a Guide? Join my mentor program..



Author: sri    04 Nov 2009Member Level: SilverRating: 4 out of 54 out of 54 out of 54 out of 5     Points: 6

hi

u created the OleDbConnection ConnObj but while
insert query is assaigned to 'con' object but in your code the con
object is not created any where

con.setdb(s11); to ConnObj.setdb(s11);



Author: Nishanth    04 Nov 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

hi
Instead by calling like this
con.setdb(s11);
call like this
SetDB(s11);



Author: Nikhil Gaur    04 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

please explain you question clearly. Because it is bit confusing.

Join this campus group
http://www.dotnetspider.com/sites/637/-ecb-aspdotnet.aspx

Thanks & Regards
NIks
My Software and Web Development Experience



Post Reply
You must Sign In to post a response.
Next : URL in JPEG file
Previous : Encryption-Decryption
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use