15,913,610 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Atul Rokade (Top 200 by date)
Atul Rokade
16-Apr-18 7:34am
View
my jsp code :
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page
<%
String employee_id=request.getParameter("txtemployeeid");
String get_project1=request.getParameter("ingr_project");
String get_header=request.getParameter("ingr_header");
String get_department=request.getParameter("ingr_department");
String get_description=request.getParameter("ingr_description");
HttpSession session1=request.getSession(true);
session1.setAttribute("txtemployeeid", employee_id);
%>
<%
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@177.18.114.213:1821:godb","xe","Spacess");
try
{
int count=0;
//String btnsubmit=Integer.parseInt(request.getParameter("btnSubmit"));
String btnsubmit=request.getParameter("btnSubmit");
if(btnsubmit!=null)
{
count=Integer.parseInt(btnsubmit.trim());
for(int i=0;i< count; i++)
{
PreparedStatement ps=con.prepareStatement("insert into Employee_task values(?,?,?,?,?)");
ps.setString(1, employee_id);
ps.setString(2, get_project1);
ps.setString(3, get_header);
ps.setString(4, get_department);
ps.setString(5, get_description);
ps.executeUpdate();
}
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
%>
Atul Rokade
16-Feb-17 12:28pm
View
Sorry im waste your precious time i will check and post as answer as soon as sorry once again
Atul Rokade
16-Feb-17 12:12pm
View
for testing purpose i done but previously code was executed as expect but now not understand where i done mistake
Atul Rokade
24-Oct-16 15:15pm
View
ok i solve the problem thank you for your suggestion actually i set datatype number for contactNo thats why overflow error was came, i change to number to memo and its woking fine
Atul Rokade
24-Oct-16 14:39pm
View
System.Data.OleDb.OleDbException was unhandled
Message="Overflow"
Source="Microsoft Office Access Database Engine"
ErrorCode=-2147217833
StackTrace:
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr)
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
at Medical.Form3.button1_Click(Object sender, EventArgs e) in E:\Project backups\Medical\Medical\Medical\Form3.cs:line 676
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Medical.Program.Main() in E:\Project backups\Medical\Medical\Medical\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Atul Rokade
13-Oct-16 14:24pm
View
Sir data is there i checked when i choose Medicine_Name : Xedo which having Expiry_Date 10/04/2018(dd/mm/yyyy)
Atul Rokade
13-Oct-16 14:15pm
View
Sir i wrote code on datagridview cellEndEdit but still im not get a output, my query is medicine_name is autocomplete text in datagridview base on this Expiry_Date should be populate here is my modify code
string connectionString = null;
connectionString = ConfigurationManager.ConnectionStrings["AccessConnectionString"].ConnectionString;
con.ConnectionString = connectionString;
string medicinename = Convert.ToString(dataGridView1.Rows[e.RowIndex].Cells["Medicine_name"].Value);
DateTime Expiry_Date = Convert.ToDateTime(dataGridView1.Rows[e.RowIndex].Cells["Expiry_Date"].Value);
con.Open();
cmd = new OleDbCommand("select Expiry_Date as Expiry_Date from Medicine_Available_Detail where Medicine_Name=@Medicine_Name",con);
cmd.Parameters.AddWithValue("@Medicine_Name",medicinename);
OleDbDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
Expiry_Date = Convert.ToDateTime(dr["Expiry_Date"]);
}
con.Close();
Atul Rokade
13-Oct-16 13:54pm
View
@Richard sir : can you give me solution on this pls
Atul Rokade
13-Oct-16 13:53pm
View
i tried everything but failed
Atul Rokade
13-Oct-16 13:01pm
View
i made changes in this line Expiry_Date = Convert.ToDateTime(dr["Expiry_Date"]); but still value is not retrieving in database :( , pls tell me on which event should i put a code so i can retrieve a value
Atul Rokade
16-Aug-16 15:07pm
View
@Maciej : this is my 2nd question only first one i deleted because of of not explaining exactly problem
Atul Rokade
29-Jul-16 6:19am
View
ok @OriginalGriff sir actually i tired various type but still failed so thats why i frustrated
Atul Rokade
29-Jul-16 6:12am
View
int Availability;
bool accountHasValue = int.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Availability"].Value.ToString(), out Availability);
if (accountHasValue)
{
cmd.Parameters.AddWithValue("@Availability", Availability);
}
else
{
cmd.Parameters.AddWithValue("@Availability", DBNull.Value);
}
this code i used another application for datagridview its working fine but same code i pasted to this application is go cmd.Parameters.AddWithValue("@Availability", DBNull.Value);
Atul Rokade
29-Jul-16 6:06am
View
OrginalGriff : sir when i used your code
object o = dataGridView1.Rows[e.RowIndex].Cells["Availability"].Value;
int availability = o == DBNull.Value ? -1 : (int)o;
cmd.Parameters.AddWithValue("@Availability", o);
its giving me You must enter a value in the 'Medicine_Available_Detail.Availability' field. exception on int n = cmd.ExecuteNonQuery(); line
Atul Rokade
29-Jul-16 6:02am
View
int Availability;
bool accountHasValue = int.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Availability"].Value.ToString(), out Availability);
if (accountHasValue)
{
cmd.Parameters.AddWithValue("@Availability", Availability);
}
else
{
cmd.Parameters.AddWithValue("@Availability", DBNull.Value);
}
this code i used another application for datagridview its working fine but same code i pasted to this application is go cmd.Parameters.AddWithValue("@Availability", DBNull.Value);
Atul Rokade
29-Jul-16 5:50am
View
Sir can you help me how can i store integer ? any code or any suggestion ?
Atul Rokade
29-Jul-16 5:41am
View
not getting sir
Atul Rokade
29-Jul-16 4:44am
View
@Michael_Davies : sir i improved the question , but still same error
Atul Rokade
29-Jul-16 4:44am
View
@OriginalGriff : sir i improved the question
Atul Rokade
29-Jul-16 4:38am
View
its showing nothing i used degugger also but its showing me null value when debuger go at that code
Atul Rokade
27-Jul-16 12:36pm
View
@jayanta : thnx bhai i got solution :) here is im pasting working code
Atul Rokade
25-Jul-16 10:14am
View
thnx RyanDev for your support
Atul Rokade
25-Jul-16 10:07am
View
@RyanDev : sir its working fine sir :) only one help i need how i enter system date into access database i use [To_Date]='" + DateTime.Now.ToShortDateString() + in query but its giving me invalid error how can i put system date in access database while updating this?
Atul Rokade
25-Jul-16 9:55am
View
Hi Member 10261484 : thnx for reply but its giving me Syntax error (missing operator) in query expression 'case when Sales_count='' then (select Sales_count from Login where [Unique_No]=@Unique_No )+1 else (select Sales_count from Login where [Unique_No]=@Unique_No )+1 end'.
Atul Rokade
25-Jul-16 9:54am
View
Hi @RyanDev : its giving me exception Wrong number of arguments used with function in query expression 'IsNull(Sales_count, 0)+'. note : im using ms access as database Provider=Microsoft.ACE.OLEDB.12.0
Atul Rokade
23-Jul-16 9:21am
View
hi @jayanta : i made changes in code now its working fine it is checking valid and invalid unique_no but problem is that is not upadating sales_count+1 in table against unique_no in update query i reomve [To_Date]='" + DateTime.Now.ToShortDateString() part so that is why code is running but not updating in table
here is im giving my code
private void button1_Click_1(object sender, EventArgs e)
{
cmd = new OleDbCommand("update Login set Sales_count=Sales_count+1 where [Unique_No]=@Unique_No", con);
cmd.Parameters.AddWithValue("@Unique_No", txtinput.Text);
con.Open();
int n = cmd.ExecuteNonQuery();
if (n==0)
{
MessageBox.Show("Invalid Unique No. pls try again later");
//this.DialogResult = DialogResult.Cancel;
}
else
{
this.DialogResult = DialogResult.OK;
}
con.Close();
}
Atul Rokade
13-Jul-16 3:21am
View
@jayanta : debugg is not coming if (dr != DialogResult.OK)
{
return;
}
this line directly went
con.Open();
int n = cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("Record Updated Successfully"); on this line
Atul Rokade
9-Jul-16 3:52am
View
i written below code but still its not working
form 3 code:
cmd = new OleDbCommand("update Medicine_Available_Detail set [Availability]=[Availability]-@Quantity where [Medicine_Name]=@Medicine_Name", con);
cmd.Parameters.AddWithValue("@Quantity", quantity);
cmd.Parameters.AddWithValue("@Medicine_Name", medicinename);
Form1 frm = new Form1();
DialogResult dr = frm.ShowDialog();
if (dr != DialogResult.OK)
{
return;
}
con.Open();
int n = cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("Record Updated Successfully");
userlist();
form 1 code:
this.txtinput.MaxLength = 4;
cmd = new OleDbCommand("update Login set [Sales_count]=[Sales_count]+1 where [Unique_No]=@Unique_No and To_Date='" + DateTime.Now + "'", con);
cmd.Parameters.AddWithValue("@Unique_No", txtinput.Text);
con.Open();
int n = cmd.ExecuteNonQuery();
if (n < 0)
{
MessageBox.Show("Invalid Unique No. pls try again later");
this.DialogResult = DialogResult.Cancel;
}
else
{
this.DialogResult = DialogResult.OK;
}
con.Close();
}
Atul Rokade
25-Jun-16 2:10am
View
i tried everything anyone can help me how to insert numeric value in to access database via datagridview
Atul Rokade
24-Jun-16 13:32pm
View
@richard i change code now freind
int Availability;
bool total_availableHasValue = Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["total_available"].Value.ToString(), out Availability);
if (total_availableHasValue)
{
cmd.Parameters.AddWithValue("@total_available", Availability);
}
else
{
cmd.Parameters.AddWithValue("@total_available", DBNull.Value);
}
but still same issue :(
Atul Rokade
24-Jun-16 13:09pm
View
int Availability;
bool total_availableHasValue = Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["total_available"].Value.ToString(), out Availability);
cmd.Parameters.AddWithValue("@total_available", Availability);
i change code but still inserting 0 value into database
Atul Rokade
24-Jun-16 12:57pm
View
i used debugger on
cmd.Parameters.AddWithValue("@total_available", total_availableHasValue);
--total_availableHasValue is showing me False
but in datagridview i enter 22
Atul Rokade
24-Jun-16 12:54pm
View
int Availability;
bool total_availableHasValue = Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["total_available"].Value.ToString(), out Availability);
cmd.Parameters.AddWithValue("@total_available", total_availableHasValue);
Atul Rokade
24-Jun-16 12:53pm
View
value inserting successfully! message has come but value insert as 0 in that column
Atul Rokade
24-Jun-16 12:41pm
View
hi Richard 1st of all thank you very much for rpl i change code like below
int Availability = Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["total_available"].Value.ToString(), out Availability);
cmd.Parameters.AddWithValue("@total_available", Availability);
but it is giving me
Cannot implicitly convert type 'bool' to 'int' error
Atul Rokade
21-Jun-16 12:57pm
View
thnx chill60 bro :)
Atul Rokade
20-Jun-16 14:23pm
View
in dataGridView1_CellEndEdit_1 event code working fine calculation also coming what we want but problem in dataGridView1_DataSourceChanged_1 event debuger not go inside the code
Atul Rokade
20-Jun-16 14:19pm
View
yes my frnd
Atul Rokade
20-Jun-16 14:15pm
View
im not using any database connection here i want to show this detail without using database in datagridview
Atul Rokade
20-Jun-16 14:14pm
View
im not connecting any database nor any table its a plain datagridview
Atul Rokade
20-Jun-16 4:50am
View
it is going private void dataGridView1_CellEndEdit_1 event but its not go inside dataGridView1_DataSourceChanged_1 event i used the debug but debugger itself not going inside dataGridView1_DataSourceChanged_1 event
Atul Rokade
20-Jun-16 4:48am
View
Dear Marc can you elaborate please
Atul Rokade
19-Jun-16 12:01pm
View
Debugger not go inside datasource code :(
Atul Rokade
5-May-16 5:53am
View
8 rows in datagridview
Atul Rokade
4-May-16 2:23am
View
hi @george
bool quanity1 = int.TryParse(dataGridView1.Rows[6].Cells["Quantity"].Value.ToString(), out Quantity);// exception coming this line
Atul Rokade
23-Apr-16 13:08pm
View
ok chill60 i will check and let me tell you . thank you for support and guide bro
Atul Rokade
23-Apr-16 11:29am
View
@chill60 brother that is .exe file , but there is any alternate solution because i was read few hour ago that is Tally supported ODBC also can we implemeneted into our c#.net? how we can pass webrequest and webresponce through c#(windows) is it possible? or xmlwebrequest and xmlwebresponce
Atul Rokade
23-Apr-16 11:02am
View
thnx for reply @chill60 but do you know about coding? how i insert data into tally from c#.net? and how can i retrieve data from tally to c#?
Atul Rokade
22-Apr-16 13:50pm
View
thank you foe help chill60 brother :) and also thank you @ppolymorphe
Atul Rokade
22-Apr-16 13:49pm
View
+10
Atul Rokade
16-Apr-16 11:51am
View
@Richard Deeming : its give me exception , on this line xlWorkSheet.Cells[1, j + 1] = ds.Tables[0].Columns[j].Caption; // cannot find column no.25
Atul Rokade
11-Apr-16 13:52pm
View
yes Richard that is true , but now it showing me data type mismatch in criteria expression should i post different question for this??
Atul Rokade
11-Apr-16 13:45pm
View
Still get same error Data type mismatch in criteria expression.
i written
DateTime chequeDate;
if (DateTime.TryParse(txtmaskchequedate.Text, out chequeDate))
{
cmd.Parameters.AddWithValue("@Cheque_Date", chequeDate);
}
else
{
cmd.Parameters.AddWithValue("@Cheque_Date", DBNull.Value);
}
Atul Rokade
11-Apr-16 13:18pm
View
hi richard i tried if (txtmaskchequedate.Text=="")
{
cmd.Parameters.AddWithValue("@Cheque_Date", DBNull.Value);
}
else
{
cmd.Parameters.AddWithValue("@Cheque_Date", DateTime.TryParse(txtmaskchequedate.Text,out value1));
}
but its giving me datatype mismatch error not getting where i doing mistake
Atul Rokade
11-Apr-16 13:09pm
View
error is coming
if (txtmaskchequedate.Text=="")
{
cmd.Parameters.AddWithValue("@Cheque_Date", DBNull.Value);
}
else
{
cmd.Parameters.AddWithValue("@Cheque_Date", DateTime.Parse(txtmaskchequedate.Text)); -----// this line
}
Atul Rokade
11-Apr-16 3:50am
View
for this i changed my code but got now different error now Object reference not set to an instance of an object. execption coming this line : cmd.CommandText = "Delete from Ledger where AccountNumber=" + dataGridView1.SelectedRows[0].Cells[0].Value.ToString() +
Atul Rokade
11-Apr-16 3:37am
View
error coming this line :
if (dataGridView1.Rows.Count > 1 && dataGridView1.SelectedRows[0].Index != dataGridView1.Rows.Count - 1 )
Atul Rokade
8-Apr-16 10:43am
View
ok guys its done in database i put null value that's why mismatch error come i changed into code ..
Atul Rokade
8-Apr-16 10:34am
View
yeah in database for Cheque_date and Bill_date i put Required : NO in access database
Atul Rokade
8-Apr-16 10:24am
View
DateTime? value1 = null;
DateTime? value2 = null;
if (value1.HasValue)
{
cmd.Parameters.AddWithValue("@Cheque_Date", DateTime.Parse(txtmaskchequedate.Text));
}
else
{
cmd.Parameters.AddWithValue("@Cheque_Date", DBNull.Value);
}
if (value2.HasValue)
{
cmd.Parameters.AddWithValue("@Bill_Date", DateTime.Parse(txtmaskbilldate.Text));
}
else
{
cmd.Parameters.AddWithValue("@Bill_Date", DBNull.Value);
}
this one i changed
Atul Rokade
6-Apr-16 3:57am
View
Data type mismatch in criteria expression. exception coming i change my code
if (value1.HasValue)
{
cmd.Parameters.AddWithValue("@Cheque_Date", Convert.ToDateTime(txtmaskchequedate.Text.ToString()));
}
else
{
cmd.Parameters.AddWithValue("@Cheque_Date", DBNull.Value);
}
if (value2.HasValue)
{
cmd.Parameters.AddWithValue("@Bill_Date", Convert.ToDateTime(txtmaskbilldate.Text.ToString()));
}
else
{
cmd.Parameters.AddWithValue("@Bill_Date", DBNull.Value);
}
Atul Rokade
28-Mar-16 14:01pm
View
you are the master originalgriff in c# learnnew things from you and yet to learn so much :)
Atul Rokade
28-Mar-16 13:37pm
View
its work originalgriff thnx a lot :)
Atul Rokade
28-Mar-16 12:17pm
View
i done this
string connectionString = ConfigurationManager.ConnectionStrings["AccessConnectionString"].ConnectionString;
using (OleDbConnection cnn = new OleDbConnection(connectionString))
{
cnn.Open();
string sql = "select * from Billing where FormNo=" + txtformno.Text + "";
using (OleDbCommand cmd = new OleDbCommand(sql, cnn))
{
using (OleDbDataReader dr = cmd.ExecuteReader())
{
txtformno.Text = dr.GetValue(0).ToString();
txtdate.Text = dr.GetValue(1).ToString();
txttruck.Text = dr.GetValue(2).ToString();
txtofficecode.Text = dr.GetValue(3).ToString();
txtpartycode.Text = dr.GetValue(4).ToString();
txtpartycode1.Text = dr.GetValue(5).ToString();
txtlocation.Text = dr.GetValue(6).ToString();
txtsupplier.Text = dr.GetValue(7).ToString();
txtitem.Text = dr.GetValue(8).ToString();
txtinvoice.Text = dr.GetValue(9).ToString();
txtmaskinvoice.Text = dr.GetValue(10).ToString();
txtpackage.Text = dr.GetValue(11).ToString();
txtwieght.Text = dr.GetValue(12).ToString();
txtinvestamount.Text = dr.GetValue(13).ToString();
txtpercentage.Text = dr.GetValue(14).ToString();
txtamount.Text = dr.GetValue(15).ToString();
txtpaymentamount.Text = dr.GetValue(16).ToString();
txtpaymenttype.Text = dr.GetValue(17).ToString();
txtbankname.Text = dr.GetValue(18).ToString();
txtchequeno.Text = dr.GetValue(19).ToString();
txtmaskchequedate.Text = dr.GetValue(20).ToString();
txtbillno.Text = dr.GetValue(21).ToString();
txtmaskbilldate.Text = dr.GetValue(22).ToString();
}
}
but when i try to search formno it giving me No data exists for the row/column. exception
Atul Rokade
28-Mar-16 9:38am
View
sent you request
Atul Rokade
28-Mar-16 9:28am
View
Deleted
my show my pc password is : 1664-2638-2516
Atul Rokade
28-Mar-16 9:19am
View
sorry i was late , had one meeting thats why r u there
Atul Rokade
28-Mar-16 9:19am
View
hi dude are you there?
Atul Rokade
28-Mar-16 4:58am
View
ok bro, thanx lot your help such heartily thank you and yes i will ping you
Atul Rokade
28-Mar-16 4:55am
View
show my pc can ok ?
Atul Rokade
28-Mar-16 4:45am
View
bro, i dont understand data inserted but why The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again exception coming??? and no still update not happening yaar :(
Atul Rokade
28-Mar-16 4:40am
View
yup its appearing in datagridview
Atul Rokade
28-Mar-16 4:13am
View
done it karthik bhai but still same error is coming while inserting .. but after giving me this exception data inserted correctly into table is ts strange feeling laugh yaar :D
Atul Rokade
28-Mar-16 4:00am
View
but is not auto increment dude
Atul Rokade
28-Mar-16 2:48am
View
in insert code i done event inseted also sucessfully but giving excpetion The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.
Atul Rokade
28-Mar-16 2:40am
View
yes account number is primary key
Atul Rokade
28-Mar-16 2:31am
View
no for update btnupdate_Click event row event only for data insert
Atul Rokade
28-Mar-16 2:20am
View
i done that also but its giving me The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again error
Atul Rokade
28-Mar-16 2:15am
View
i think insert code restricted to update data here my insert code also
private void dataGridView1_RowLeave(object sender, DataGridViewCellEventArgs e)
{
if (dataGridView1.IsCurrentRowDirty)// this line may be create a issue??
{
string connectionString = null;
connectionString = ConfigurationManager.ConnectionStrings["AccessConnectionString"].ConnectionString;
con.ConnectionString = connectionString;
string cmd1 = "insert into Ledger([AccountNumber],[Account],[Date],[Description],[Post_Ref],[Debit],[Credit],[Balance])values(?,?,?,?,?,?,?,?)";
OleDbCommand cmd = new OleDbCommand(cmd1, con);
cmd.CommandType = CommandType.Text;
int accountNumber;
bool accountHasValue = int.TryParse(dataGridView1.Rows[e.RowIndex].Cells["AccountNumber"].Value.ToString(), out accountNumber);
if (accountHasValue)
{
cmd.Parameters.AddWithValue("@AccountNumber", accountNumber);
}
else
{
cmd.Parameters.AddWithValue("@AccountNumber", DBNull.Value);
}
string accounts = dataGridView1.Rows[e.RowIndex].Cells["Account"].Value.ToString();
cmd.Parameters.AddWithValue("@Account", accounts);
DateTime datetime;
bool dateTimeHasValue = DateTime.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Date"].Value.ToString(), out datetime);
if (dateTimeHasValue)
{
cmd.Parameters.AddWithValue("@Date", datetime);
}
else
{
cmd.Parameters.AddWithValue("@Date", DBNull.Value);
}
string Description = dataGridView1.Rows[e.RowIndex].Cells["Description"].Value.ToString();
cmd.Parameters.AddWithValue("@Description", Description);
string Post_Ref = dataGridView1.Rows[e.RowIndex].Cells["Post_Ref"].Value.ToString();
cmd.Parameters.AddWithValue("@Post_Ref", Post_Ref);
int debit;
bool debitHasValue = Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Debit"].Value.ToString(), out debit);
if (debitHasValue)
{
cmd.Parameters.AddWithValue("@Debit", debit);
}
else
{
cmd.Parameters.AddWithValue("@Debit", DBNull.Value);
}
int Credits;
bool CreditsHasValue = Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Credit"].Value.ToString(), out Credits);
if (CreditsHasValue)
{
cmd.Parameters.AddWithValue("@Credit", Credits);
}
else
{
cmd.Parameters.AddWithValue("@Credit", DBNull.Value);
}
int Balances;
bool BalancesHasValue = Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Balance"].Value.ToString(), out Balances);
if (BalancesHasValue)
{
cmd.Parameters.AddWithValue("@Balance", Balances);
}
else
{
cmd.Parameters.AddWithValue("@Balance", DBNull.Value);
}
con.Open();
int n = cmd.ExecuteNonQuery();
con.Close();
if (n > 0)
{
MessageBox.Show("Data Inserted Successfully", "Data Inserted ", MessageBoxButtons.OK, MessageBoxIcon.Information);
Load_data();
}
}
Atul Rokade
28-Mar-16 2:08am
View
actually im update acess database some value its updating
Atul Rokade
28-Mar-16 2:03am
View
actually for insertion data i used dataGridView1.IsCurrentRowDirty for this only causes the problem??
Atul Rokade
28-Mar-16 2:01am
View
sorry karthik but understand your point
Atul Rokade
28-Mar-16 1:56am
View
AccountNumber| Account| Date | Description | Post_Ref | Debit | Credit | Balance
101 abc1 10/05/2015 abc1 postred 10000 2000 8000
102 abc2 10/03/2016 abcj default 20000 5000 15000
this data available into database
Atul Rokade
28-Mar-16 1:49am
View
account number is pk so i wont update that, and yes account number is available into database
Atul Rokade
28-Mar-16 1:35am
View
in debugging i check debugg going into dataGridView1_RowLeave event(having insert code)
checking first line
if (dataGridView1.IsCurrentRowDirty)
{
//insert code is here
}
Atul Rokade
28-Mar-16 1:34am
View
i check using break point , in datagridview i updated account abc to abc2 while checking debugging i saw account.text is change abc to abc2(in debug mode)
Atul Rokade
28-Mar-16 1:29am
View
i done but still no data updated
OleDbCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from Ledger";
DataTable dt = new DataTable();
OleDbDataAdapter adapater = new OleDbDataAdapter(cmd);
con.Open();
adapater.Fill(dt);
cmd.ExecuteNonQuery();
con.Close();
dataGridView1.DataSource = dt;
Atul Rokade
28-Mar-16 1:21am
View
public void Load_data()
{
OleDbCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from Ledger";
DataTable dt = new DataTable();
OleDbDataAdapter adapater = new OleDbDataAdapter(cmd);
adapater.Fill(dt);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
dataGridView1.DataSource = dt;
}
i done it but still data not updated
Atul Rokade
28-Mar-16 1:19am
View
no... i changed now code but still data not updated
private void btnupdate_Click(object sender, EventArgs e)
{
if (txtaccount.Text != "" && txtmaskdate.Text.ToString() != "" && txtdescription.Text != "" && txtpost_ref.Text != "" && txtdebit.Text != "" && txtcredit.Text != "")
{
cmd = new OleDbCommand("update Ledger set [Account]=@Account,[Date]=@Date,[Description]=@Description,[Post_Ref]=@Post_ref,[Debit]=@Debit,[Credit]=@Credit,[Balance]=@Balance where [AccountNumber]=@accountnumber", con);
cmd.Parameters.AddWithValue("@AccountNumber", accountnumber);
cmd.Parameters.AddWithValue("@Account", txtaccount.Text);
cmd.Parameters.AddWithValue("@Date", txtmaskdate.Text.ToString());
cmd.Parameters.AddWithValue("@Description", txtdescription.Text);
cmd.Parameters.AddWithValue("@Post_Ref", txtpost_ref.Text);
cmd.Parameters.AddWithValue("@Debit", txtdebit.Text);
cmd.Parameters.AddWithValue("@Credit", txtcredit.Text);
cmd.Parameters.AddWithValue("@Balance", txtbalance.Text);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("Record Updated Successfully");
dataGridView1.DataSource = "Ledger";
Load_data();
}
Atul Rokade
28-Mar-16 1:13am
View
thanx mangal for replying but in windows application .databind() method is not
Atul Rokade
26-Mar-16 13:00pm
View
how could i do that??? in inert code?
Atul Rokade
26-Mar-16 10:57am
View
sascha brother: im closely look now by using debugger, i saw when update one row , its updated but what happen debugger going into dataGridView1_RowLeave event which have insert statement so insert statement create duplicate entry
Atul Rokade
26-Mar-16 9:59am
View
now Parameter @Date has no default value exception is coming .. actually we are not finding what is exactly issue
Atul Rokade
26-Mar-16 9:32am
View
not getting sascha?
Atul Rokade
26-Mar-16 4:42am
View
i written update code on dataGridView1_CellValueChanged event its any cause??
Atul Rokade
26-Mar-16 4:38am
View
actually what happening when im trying to do updating cell its giving me error but also i saw its creating duplicate insert row(s) also
Atul Rokade
26-Mar-16 4:31am
View
i check Description column in table there Default value is nothing not even all fields
Atul Rokade
26-Mar-16 4:19am
View
still same error Parameter @Description has no default value. i changed
if (!object.ReferenceEquals(dataGridView1.CurrentRow.Cells[3].Value, DBNull.Value))
{
Description = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();
Atul Rokade
26-Mar-16 2:55am
View
hello,
iam modify my update code but now its giving me Parameter @Description has no default value.
<pre lang="c#">
private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
int accountnumber=0;
string Account="";
DateTime ? Date=null;
string Description = "";
string Post_ref="";
int Debit=0;
int Credit=0;
int Balance=0;
if (!object.ReferenceEquals(dataGridView1.CurrentRow.Cells[0].Value, DBNull.Value))
{
accountnumber = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString());
}
else
if (!object.ReferenceEquals(dataGridView1.CurrentRow.Cells[1].Value, DBNull.Value))
{
Account = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
}
else if (!object.ReferenceEquals(dataGridView1.CurrentRow.Cells[2].Value, DBNull.Value))
{
Date = Convert.ToDateTime(dataGridView1.Rows[e.RowIndex].Cells[2].Value);
}
else if (!object.ReferenceEquals(dataGridView1.CurrentRow.Cells[3].Value,null))
{
Description = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();
}
else if (!object.ReferenceEquals(dataGridView1.CurrentRow.Cells[4].Value,null))
{
Post_ref = dataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString();
}
else if (!object.ReferenceEquals(dataGridView1.CurrentRow.Cells[5].Value, DBNull.Value))
{
Debit = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString());
}
else if (!object.ReferenceEquals(dataGridView1.CurrentRow.Cells[6].Value, DBNull.Value))
{
Credit = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[6].Value.ToString());
}
else if (!object.ReferenceEquals(dataGridView1.CurrentRow.Cells[7].Value, DBNull.Value))
{
Balance = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[7].Value.ToString());
}
string cmd1 = ("update Ledger set [Account]=@Account,[Date]=@Date,[Description]=@Description,[Post_Ref]=@Post_ref,[Debit]=@Debit,[Credit]=@Credit,[Balance]=@Balance where [AccountNumber]=@accountnumber");
OleDbCommand cmd = new OleDbCommand(cmd1, con);
con.Open();
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@AccountNumber",accountnumber);
cmd.Parameters.AddWithValue("@Account", Account);
cmd.Parameters.AddWithValue("@Date", Date);
cmd.Parameters.AddWithValue("@Description", Description);
cmd.Parameters.AddWithValue("@Post_Ref", Post_ref);
cmd.Parameters.AddWithValue("@Debit", Debit);
cmd.Parameters.AddWithValue("@Credit", Credit);
cmd.Parameters.AddWithValue("@Balance", Balance);
cmd.ExecuteNonQuery();
con.Close();
Load_data();
dataGridView1.DataSource = null;
dataGridView1.Refresh();
}
</pre>
Atul Rokade
25-Mar-16 18:01pm
View
ok sascha i will do that and let me tell you .. but thanx man for such good helping .. :)
Atul Rokade
25-Mar-16 17:18pm
View
thank you for replying sascha im check by using debugging also i updated account's one row when i was debugging its show me value is updated but when open the form i havent see updated value :(
Atul Rokade
25-Mar-16 16:29pm
View
you have any idea about update?
Atul Rokade
25-Mar-16 14:55pm
View
now insert query running fine but prblem is when im trying to do update again multiple insert (duplicate) row inserted i written update code on dataGridView1_CellValueChanged event for that's why this is happen?
Atul Rokade
25-Mar-16 6:06am
View
no still double duplicate entry done!
Atul Rokade
25-Mar-16 2:04am
View
now what happening if i insert(multiple rows are inserted) if i updated one row multiple rows updated why this?
Atul Rokade
25-Mar-16 1:57am
View
@sascha : i written code on RowLeave event (insert code) but still multiple value coming
Atul Rokade
24-Mar-16 6:34am
View
i changes the code but now prblem is what when i search start_date suppose 17/02/2015 and end_date 24/03/2016 datagridview show me blank, but in table having value 17/02/2015 here is my modify code
string connetionString = null;
connetionString = ConfigurationManager.ConnectionStrings["AccessConnectionString"].ConnectionString;
cnn.ConnectionString = connetionString;
cmd = new OleDbCommand("SELECT * FROM Billing " + "WHERE Date between ? AND ?");
cmd.Parameters.AddWithValue("?", dateTimePicker1.Value);
cmd.Parameters.AddWithValue("?", dateTimePicker2.Value);
OleDbConnection connection = new OleDbConnection(connetionString);
OleDbDataAdapter dataadapter = new OleDbDataAdapter();
DataSet ds = new DataSet();
connection.Open();
dataadapter.SelectCommand = cmd;
connection.Close();
dataGridView1.DataSource = ds;
Atul Rokade
24-Mar-16 5:57am
View
sir if you dont mind can you modify my code?? because i really not understand how should i do this
Atul Rokade
22-Mar-16 14:30pm
View
int accountNumber;
bool accountHasValue = int.TryParse(dataGridView1.Rows[e.RowIndex].Cells["AccountNumber"].Value.ToString(), out accountNumber);
if (accountHasValue)
{
cmd.Parameters.AddWithValue("@AccountNumber", accountNumber);
}
string accounts = dataGridView1.Rows[e.RowIndex].Cells["Account"].Value.ToString();
cmd.Parameters.AddWithValue("@Account", accounts);
DateTime datetime;
bool dateTimeHasValue = DateTime.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Date"].Value.ToString(), out datetime);
if (dateTimeHasValue)
{
cmd.Parameters.AddWithValue("@Date", datetime);
}
string Description = dataGridView1.Rows[e.RowIndex].Cells["Description"].Value.ToString();
cmd.Parameters.AddWithValue("@Description", Description);
string Post_Ref = dataGridView1.Rows[e.RowIndex].Cells["Post_Ref"].Value.ToString();
cmd.Parameters.AddWithValue("@Post_Ref", Post_Ref);
int debit;
bool debitHasValue = Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Debit"].Value.ToString(), out debit);
if (debitHasValue)
{
cmd.Parameters.AddWithValue("@Debit", debit);
}
int Credits;
bool CreditsHasValue = Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Credit"].Value.ToString(), out Credits);
if (CreditsHasValue)
{
cmd.Parameters.AddWithValue("@Credit", Credits);
}
int Balances;
bool BalancesHasValue = Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Balance"].Value.ToString(), out Balances);
if (BalancesHasValue)
{
cmd.Parameters.AddWithValue("@Balance", Balances);
}
cmd.ExecuteNonQuery();
con.Close();
Load_data();
Atul Rokade
22-Mar-16 14:30pm
View
actually now ima changes into code also but now its giving me No value given for one or more required parameters.
Atul Rokade
22-Mar-16 13:48pm
View
dear sir i already given my table structure in question :)
actually now im fed up :( last three days im fixing problem by using various way but still not fixed .. my simple motto is i want insert update data in datagridview at runtime but still im not get solution and above code is right now im focusing,
Atul Rokade
22-Mar-16 13:30pm
View
Object cannot be cast from DBNull to other types.
DateTime dates = Convert.ToDateTime(dataGridView1.Rows[e.RowIndex].Cells["Date"].Value);
when i change the code
Atul Rokade
21-Mar-16 13:26pm
View
ok chill60 i will try this thank you for help
Atul Rokade
21-Mar-16 12:54pm
View
that only im not getting sir ... i stuck frankly speak
Atul Rokade
21-Mar-16 12:47pm
View
thank you sir for reply but im not use here any concatenation , please sir can you give me any solution please about this problem
Atul Rokade
21-Mar-16 12:14pm
View
sir please i need your help could you help me please
Atul Rokade
20-Mar-16 14:40pm
View
griff sir i done this
cmd.Parameters.AddWithValue("@Account",dataGridView1.Rows[e.RowIndex].Cells["Account"].Value.ToString());
cmd.Parameters.AddWithValue("@AccountNumber",int.TryParse(dataGridView1.Rows[e.RowIndex].Cells["AccountNumber"].Value));
cmd.Parameters.AddWithValue("@Date", DateTime.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Date"].Value));
cmd.Parameters.AddWithValue("@Description", dataGridView1.Rows[e.RowIndex].Cells["Description"].Value.ToString());
cmd.Parameters.AddWithValue("@Post_Ref", dataGridView1.Rows[e.RowIndex].Cells["Post_Ref"].Value.ToString());
cmd.Parameters.AddWithValue("@Debit", Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Debit"].Value));
cmd.Parameters.AddWithValue("@Credit", Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Credit"].Value));
cmd.Parameters.AddWithValue("@Balance", Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Balance"].Value));
but still it giving me Error No overload for method 'TryParse' takes '1' arguments
Atul Rokade
20-Mar-16 14:17pm
View
sir its giving me Error No overload for method 'TryParse' takes '1' arguments
i written code
cmd.Parameters.AddWithValue("@Account",dataGridView1.Rows[e.RowIndex].Cells["Account"].Value.ToString());
cmd.Parameters.AddWithValue("@AccountNumber",Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["AccountNumber"].Value.ToString()));
cmd.Parameters.AddWithValue("@Date", DateTime.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Date"].Value.ToString()));
cmd.Parameters.AddWithValue("@Description", dataGridView1.Rows[e.RowIndex].Cells["Description"].Value.ToString());
cmd.Parameters.AddWithValue("@Post_Ref", dataGridView1.Rows[e.RowIndex].Cells["Post_Ref"].Value.ToString());
cmd.Parameters.AddWithValue("@Debit", Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Debit"].Value.ToString()));
cmd.Parameters.AddWithValue("@Credit", Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Credit"].Value.ToString()));
cmd.Parameters.AddWithValue("@Balance", Int32.TryParse(dataGridView1.Rows[e.RowIndex].Cells["Balance"].Value.ToString()));
Atul Rokade
20-Mar-16 13:51pm
View
still got same error sir i changed into code
string connectionString = null;
connectionString = ConfigurationManager.ConnectionStrings["AccessConnectionString"].ConnectionString;
con.ConnectionString = connectionString;
string cmd1 = "insert into Ledger([Account],[AccountNumber],[Date],[Description],[Post_Ref],[Debit],[Credit],[Balance])values(?,?,?,?,?,?,?,?)";
OleDbCommand cmd = new OleDbCommand(cmd1, con);
con.Open();
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@Account",dataGridView1.Rows[e.RowIndex].Cells["Account"].Value.ToString());
cmd.Parameters.AddWithValue("@AccountNumber", dataGridView1.Rows[e.RowIndex].Cells["AccountNumber"].Value.ToString());
cmd.Parameters.AddWithValue("@Date", dataGridView1.Rows[e.RowIndex].Cells["Date"].Value.ToString());
cmd.Parameters.AddWithValue("@Description", dataGridView1.Rows[e.RowIndex].Cells["Description"].Value.ToString());
cmd.Parameters.AddWithValue("@Post_Ref", dataGridView1.Rows[e.RowIndex].Cells["Post_Ref"].Value.ToString());
cmd.Parameters.AddWithValue("@Debit", dataGridView1.Rows[e.RowIndex].Cells["Debit"].Value.ToString());
cmd.Parameters.AddWithValue("@Credit", dataGridView1.Rows[e.RowIndex].Cells["Credit"].Value.ToString());
cmd.Parameters.AddWithValue("@Balance", dataGridView1.Rows[e.RowIndex].Cells["Balance"].Value.ToString());
int n = cmd.ExecuteNonQuery();
con.Close();
Load_data();
Atul Rokade
20-Mar-16 13:51pm
View
still got same error sir i changed into code
string connectionString = null;
connectionString = ConfigurationManager.ConnectionStrings["AccessConnectionString"].ConnectionString;
con.ConnectionString = connectionString;
string cmd1 = "insert into Ledger([Account],[AccountNumber],[Date],[Description],[Post_Ref],[Debit],[Credit],[Balance])values(?,?,?,?,?,?,?,?)";
OleDbCommand cmd = new OleDbCommand(cmd1, con);
con.Open();
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@Account",dataGridView1.Rows[e.RowIndex].Cells["Account"].Value.ToString());
cmd.Parameters.AddWithValue("@AccountNumber", dataGridView1.Rows[e.RowIndex].Cells["AccountNumber"].Value.ToString());
cmd.Parameters.AddWithValue("@Date", dataGridView1.Rows[e.RowIndex].Cells["Date"].Value.ToString());
cmd.Parameters.AddWithValue("@Description", dataGridView1.Rows[e.RowIndex].Cells["Description"].Value.ToString());
cmd.Parameters.AddWithValue("@Post_Ref", dataGridView1.Rows[e.RowIndex].Cells["Post_Ref"].Value.ToString());
cmd.Parameters.AddWithValue("@Debit", dataGridView1.Rows[e.RowIndex].Cells["Debit"].Value.ToString());
cmd.Parameters.AddWithValue("@Credit", dataGridView1.Rows[e.RowIndex].Cells["Credit"].Value.ToString());
cmd.Parameters.AddWithValue("@Balance", dataGridView1.Rows[e.RowIndex].Cells["Balance"].Value.ToString());
int n = cmd.ExecuteNonQuery();
con.Close();
Load_data();
Atul Rokade
20-Mar-16 13:11pm
View
ok sir i will try this
Atul Rokade
20-Mar-16 12:38pm
View
thank you for reply sir , but how could i do this ? because its datagridview how can i added parameterized queries for datagridview
Atul Rokade
20-Mar-16 12:37pm
View
thank you for reply sir , but how could i do this ? because its datagridview how can i added parameterized queries for datagridview
Atul Rokade
20-Mar-16 1:49am
View
i changed connection string now
add name="AccessConnectionString" connectionString="Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\BillAndReceipt.accdb;Persist Security Info=False;Provider=SQLOLEDB" providerName="System.Data.OleDb.OleDbConnection"
now it giving me cnn.open() this line
Invalid connection string attribute
Atul Rokade
20-Mar-16 1:43am
View
Manas_kumar bhai : yes bhai im not added configurationManager.dll file i added that but now different error is coming
An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.
Atul Rokade
20-Mar-16 1:29am
View
manas bhai : i was tried this also but ConfigurationManager doesnot exist error is come
Atul Rokade
20-Mar-16 1:18am
View
thnx @Homero bro for your such nice help ! but bro still i got same error is this i change again web.config file i thought may be connection not getting app settings but still problem is as it is
connectionStrings
appSettings
add key="AccessConnectionString" value="Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\BillAndReceipt.accdb;Persist Security Info=False;" providerName="System.Data.OleDb"
appSettings- close here
connectionStrings--close here
Atul Rokade
20-Mar-16 0:58am
View
@Homero: sorry bro but this time also not done ... The name 'ConfigurationManager' does not exist in the current context error is coming
note: im using visual studio 2008 and i think in this editor not having ConfigurationManager instead of ConfigurationManager they put ConfigurationSettings...
Atul Rokade
20-Mar-16 0:43am
View
@Homero : Error 1 The name 'ConfigurationManager' does not exist in the current context im using visual studio 2008
Atul Rokade
20-Mar-16 0:36am
View
@Homero : i changed it but still got same error
Atul Rokade
20-Mar-16 0:32am
View
@Homero : im using access database and my file extension is .accdb
Atul Rokade
20-Mar-16 0:26am
View
i changed in web.config file put
add name="AccessConnectionString" connectionString="Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\BillAndReceipt.mdb;Persist Security Info=False;" providerName="System.Data.OleDb"
but still got same error
Atul Rokade
17-Mar-16 15:41pm
View
ok.. :)
Atul Rokade
17-Mar-16 15:30pm
View
ok thanx a lot sir actually its not work yet but still thank you very much for your help god bless you :)
Atul Rokade
17-Mar-16 15:04pm
View
RyanDev sir,
sir i was my side but still not success if you dont mind can you give me modified code please
Atul Rokade
17-Mar-16 13:46pm
View
RyanDev sir ,
i just explain you my question if person type auto complete textbox any data, if data exist he can be see, if data not exist into table one pop up will open that tell "data not exist do you want to create" if user click yes then at same point whatever he typed it can be store into table , so next time when he type that inserted name he can be see auto complete textbox
Atul Rokade
17-Mar-16 13:00pm
View
YES SIR.. and it will populate in textbox else it will ask you record not cound you want to create
Atul Rokade
17-Mar-16 12:19pm
View
RyanDev sir still its not going else condition see i wrote below code if i write dr.Read() after ab = dr[0].ToString(); bc = dr[1].ToString(); its throw me error No data exists for the row/column.
if (dr.HasRows)
{
dr.Read();
ab = dr[0].ToString();
bc = dr[1].ToString();
}
Atul Rokade
17-Mar-16 12:11pm
View
but its not coming in else condition if it not found record
Atul Rokade
17-Mar-16 11:50am
View
now im modified my code in TextChanged event i wrote following code
string ab =(txtpartycode.Text);
string bc = txtpartycode1.Text;
con = new OleDbConnection(@" provider=Microsoft.ACE.OLEDB.12.0; Data Source=E:\Database\BillAndReceipt.accdb;Persist Security Info=False;");
con.Open();
string query = "Select Party_Code,Party_Code1 from Billing";
OleDbCommand cmd1 = new OleDbCommand(query, con);
OleDbDataReader dr = cmd1.ExecuteReader();
if (dr.Read())
{
ab = dr[4].ToString();--> this line give me exception index was outside the bounds of the array
bc = dr[5].ToString();
}
else
{
DialogResult dialogResult = MessageBox.Show("Data Not Found Do you want to create?", "Data insert Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (dialogResult == DialogResult.Yes)
{
string SqlString = "Insert Into Billing (Party_Code,Party_Code1)Values (?,?)";
using (OleDbCommand cmd = new OleDbCommand(SqlString, con))
{
con.Open();
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@Party_Code", txtpartycode.Text);
cmd.Parameters.AddWithValue("@Party_Code1", txtpartycode1.Text);
int n = cmd.ExecuteNonQuery();
con.Close();
if (n > 0)
{
MessageBox.Show("Data Inserted Successfully", "Data Inserted ", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("Data Not inserted", "Data not Inserted ", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}
con.Close();
Atul Rokade
3-Mar-16 13:36pm
View
brother its a winform application
Atul Rokade
3-Mar-16 7:54am
View
could you pls elaborate
Atul Rokade
17-Feb-16 12:27pm
View
now exception coming null pointer exception cmd.Parameters.AddWithValue("@pictureBox4", photo_aray); line
Atul Rokade
17-Feb-16 12:07pm
View
Deleted
hi , i modified code
string SqlString = "Insert Into RegistrationForm (ClientCount,Name,Address,Contact,Documents,Money_Taking_Date,Muddat,Money_Return_date,Account_status,Taking_Amout,Interest_per_month,Pending_interest_month,Pending_interst_Amount,Total_Amount,Client_image,Document_image1,Document_image2) Values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
using (OleDbConnection conn = new OleDbConnection(SqlString))
{
conv_photo();
using (OleDbCommand cmd = new OleDbCommand(SqlString, conn))
{
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("ClientCount", lblcount.Text);
cmd.Parameters.AddWithValue("Name", textBox20.Text);
cmd.Parameters.AddWithValue("Address", textBox21.Text);
cmd.Parameters.AddWithValue("Contact", textBox19.Text);
cmd.Parameters.AddWithValue("Documents", textBox18.Text);
cmd.Parameters.AddWithValue("Money_Taking_Date", maskedTextBox1.Text.ToString());
cmd.Parameters.AddWithValue("Muddat", textBox22.Text);
cmd.Parameters.AddWithValue("Money_Return_date", maskedTextBox2.Text.ToString());
cmd.Parameters.AddWithValue("Account_status", textBox23.Text);
cmd.Parameters.AddWithValue("Taking_Amout", textBox17.Text);
cmd.Parameters.AddWithValue("Interest_per_month", textBox16.Text);
cmd.Parameters.AddWithValue("Pending_interest_month", textBox15.Text);
cmd.Parameters.AddWithValue("Pending_interst_Amount", Convert.ToDouble(textBox13.Text));
cmd.Parameters.AddWithValue("Total_Amount", Convert.ToDouble(textBox14.Text));
cmd.Parameters.AddWithValue("@Client_image", pictureBox6);
cmd.Parameters.AddWithValue("Document_image1", pictureBox4);
cmd.Parameters.AddWithValue("Document_image2", pictureBox5);
conn.Open();
int n=cmd.ExecuteNonQuery();
conn.Close();
if (n > 0)
{
MessageBox.Show("record inserted");
loaddata();
// rno++;
}
else
MessageBox.Show("insertion failed");
conv_photo method : public void conv_photo()
{
//converting photo to binary data
if (pictureBox6.Image != null)
{
//using MemoryStream:
ms = new MemoryStream();
pictureBox6.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] photo_aray = new byte[ms.Length];
ms.Position = 0;
ms.Read(photo_aray, 0, photo_aray.Length);
cmd.Parameters.AddWithValue("@pictureBox6", photo_aray);
}
if (pictureBox4.Image != null)
{
//using MemoryStream:
ms = new MemoryStream();
pictureBox4.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] photo_aray = new byte[ms.Length];
ms.Position = 0;
ms.Read(photo_aray, 0, photo_aray.Length);
cmd.Parameters.AddWithValue("@pictureBox4", photo_aray);
}
if (pictureBox5.Image != null)
{
//using MemoryStream:
ms = new MemoryStream();
pictureBox5.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] photo_aray = new byte[ms.Length];
ms.Position = 0;
ms.Read(photo_aray, 0, photo_aray.Length);
cmd.Parameters.AddWithValue("@pictureBox5", phot
Atul Rokade
17-Feb-16 0:43am
View
ok sir i got it thank you :) , but having little doubt how i insert image into database? Retrieve? and update
Atul Rokade
17-Feb-16 0:42am
View
ok sir i got it thank you :) , but having little doubt how i insert image into database? Retrieve? and update
Atul Rokade
17-Feb-16 0:38am
View
frankly speaking i really unaware of parameterised queries sir, if you give me example from above code so it can be better understand to me also im using access database so parameterized queries helpful for that? if yes then how?
Atul Rokade
17-Feb-16 0:36am
View
exception coming syntax error
Atul Rokade
17-Feb-16 0:34am
View
how could i right that??? if you dont mind can you give me example please
Atul Rokade
21-Apr-13 5:11am
View
error is giving when i build the setup that time its giving me oledb32.dll error
Atul Rokade
17-Apr-13 9:23am
View
thnx sandeep for ur comment but bro still im not getting :( can u provide me ur project snap-short or steps pls its really understandable this is not get :(
Atul Rokade
15-Apr-13 15:12pm
View
ThePhantomUpvoter : im google it bro bt cann't find proper ans :(
Atul Rokade
14-Apr-13 3:20am
View
sergey sir:D there is label in ado.net
Atul Rokade
14-Apr-13 3:15am
View
original griff sir i created one query bt give me Type DATE is not a defined system type. error query is SELECT PationName, ContactNo FROM Physio_cureTable
WHERE CAST(DateOfBirth AS DATE) = CONVERT(VARCHAR(10),GETDATE(),111)
Atul Rokade
14-Apr-13 3:03am
View
actually im not getting how to show retrieve value in label that is name of person who have birthday and what query should i write for that
Atul Rokade
24-Mar-13 3:58am
View
and i won't have problem in RegistrationDate i have problem in dateofbirth field it is store mm/dd/yyyy format but cant retrieve dd/mm/yyyy format
Atul Rokade
24-Mar-13 3:58am
View
and i won't have problem in RegistrationDate i have problem in dateofbirth field it is store mm/dd/yyyy format but cant retrieve dd/mm/yyyy format
Atul Rokade
24-Mar-13 3:57am
View
it is datetime field
Atul Rokade
24-Mar-13 3:57am
View
prasad dude yes i have tried to execute this query and it is giving me perfect output and RegistrationDate i have use datetime and dateofbirth also datetime
Atul Rokade
13-Mar-13 3:24am
View
ok shubham sir :)
Atul Rokade
13-Mar-13 3:18am
View
ok then sir :) i just implement your solution n convinced mad client ;) thank u very much ur support and solution :)
Atul Rokade
13-Mar-13 3:09am
View
ya sergey sir, whatever u said it acceptable for my side but client doesn't want that :( :'( that's the problem otherwise your solution is best ..
Atul Rokade
13-Mar-13 2:58am
View
thank you sir sergey sir your valuable response but i want do this using one fileupload control only ;)
Atul Rokade
13-Mar-13 2:40am
View
azziet sir can u explain me brief.
imtiyaz_mi sir im using normal fileupload control
Atul Rokade
26-Feb-13 8:36am
View
khalid sir im paste my full code please checkout
note: im using asp.net 2.0 ans ajax control 1.0
Atul Rokade
26-Feb-13 3:26am
View
my issue is when i run program its run bt rating control not rated so thats why im debug code so there im find breakpoint not going in if condition my question is how can i rate the rating control n how can i store them in database
Atul Rokade
26-Feb-13 2:51am
View
no sir data is blank in rating table
table structure is
Column Name Data Type Allow Nulls
Id Int(Set Identity=true) No
Rate int Yes
data insert in cs page only
Atul Rokade
26-Feb-13 2:21am
View
thank you sandeep bro :)
Atul Rokade
11-Feb-13 10:34am
View
Andi There is no error while compiling or running, above my code is not given me what i want output like i want if suppose today is your birthday then it should show in .cs form in label "Happy Birthday to Adreas Gieriet" hope this time you are understand my problem
:)
Atul Rokade
1-Feb-13 13:22pm
View
ok jibesh sir :) ;) thnx for suggestion
Atul Rokade
1-Feb-13 12:23pm
View
Deleted
ok. then how can i bind datagridview ?
Atul Rokade
1-Feb-13 12:07pm
View
ok im remove this now sir
Atul Rokade
29-Jan-13 14:34pm
View
thank you and god bless you :)
Atul Rokade
29-Jan-13 14:33pm
View
thank you very much god bless you :)
Atul Rokade
29-Jan-13 14:31pm
View
ok jibesh sir now my concept about timer is very clear thank you very very much for your valuable support :)
Atul Rokade
29-Jan-13 14:16pm
View
jibesh sir i thought timer can run automatically without user clicking any button if condition met timer.. he will do his job user cannot do anything in this condition . it my concept and one of our member also suggest me use timer in your application that's why i used :)
Atul Rokade
29-Jan-13 14:08pm
View
jibesh sir same problem it execute many times i write timer.stop() method in if condition then also this problem come
Atul Rokade
29-Jan-13 13:59pm
View
n what about timer.stop() method can i write in timer_elapsed event?
Atul Rokade
29-Jan-13 13:51pm
View
jibesh sir this time timer run only one time and timer successfully executed at given time but..this methods y not execute in form load n timer_elapsed
Atul Rokade
29-Jan-13 13:45pm
View
ok..now?
Atul Rokade
29-Jan-13 13:40pm
View
iam put here im update code
globally i define
private System.Timers.Timer timer = null;
in constructor i write
timer = new System.Timers.Timer();
timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
timer.Interval = 5000;
timer.Start()
and in timer_elapsed
if ((DateTime.Now.DayOfWeek == DayOfWeek.Tuesday) && (DateTime.Now.Hour ==00) && (DateTime.Now.Minute ==03))
{
emailattachment();
}
timer.Stop();
Atul Rokade
29-Jan-13 13:38pm
View
yes sir it is windows application n no im not delete timer.stop method
Atul Rokade
29-Jan-13 13:34pm
View
jibesh sir i put break point in timer_elapsed method but nothing happen no error come ,no timer execute :(
Atul Rokade
29-Jan-13 13:18pm
View
ya sir have if condition in timer_elapsed event
if ((DateTime.Now.DayOfWeek == DayOfWeek.Tuesday) && (DateTime.Now.Hour ==23) && (DateTime.Now.Minute ==27))
{
emailattachment();
} this one
Atul Rokade
29-Jan-13 13:01pm
View
jibesh bro i do whatever u said but now timer not executed here im paste code please checkout
in constructor i write
timer = new System.Timers.Timer();
timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
timer.Interval = 5000;
timer.Start();
and timer_elapsed event i write
if ((DateTime.Now.DayOfWeek == DayOfWeek.Tuesday) && (DateTime.Now.Hour ==23) && (DateTime.Now.Minute ==27))
{
emailattachment();
}
timer.Stop();
Atul Rokade
29-Jan-13 12:55pm
View
then where i can define timer.start() method?
Atul Rokade
29-Jan-13 12:54pm
View
jibesh sir i want suppose day=tuesday and time=23 and min=24 then emailattachment file execute email sent to client like that
Atul Rokade
29-Jan-13 12:12pm
View
sorry bro but timer not executed at define time
Atul Rokade
29-Jan-13 12:07pm
View
why you write private DoProcess()
{
timer.Start();
}
this line im not getting
Atul Rokade
29-Jan-13 12:02pm
View
jibesh sir but when i use timer.start() method in timer_Elapsed event it give me Error The name 'timer' does not exist in the current context here is my timer_Elapsed event code
private void timer_Elapsed(object source, ElapsedEventArgs e)
{
timer.Start();
if ((DateTime.Now.DayOfWeek == DayOfWeek.Tuesday) && (DateTime.Now.Hour ==22) && (DateTime.Now.Minute ==28))
{
emailattachment();
}
timer.Stop();
//timer = null;
//timer.Interval = 1;
// timer.Stop();// stops the timer
//timer.Dispose();
//timer.Close();
}
and in constructor i create timer object
Atul Rokade
29-Jan-13 11:44am
View
raja sir now timer not executed
Atul Rokade
29-Jan-13 11:34am
View
i define timer globally but now timer not execute n we cannot write timer=null at globally
Atul Rokade
29-Jan-13 11:30am
View
where i put timer=null????
Atul Rokade
29-Jan-13 10:59am
View
jibesh sir it varchar
Atul Rokade
28-Jan-13 8:06am
View
dear programfox sir timer work fine now but problem is it executed many time timer.stop() method not fire other wise mail going softly at exactly time n day define.. can u help me out pls
Atul Rokade
26-Jan-13 12:57pm
View
ok sir i'll try this
Atul Rokade
26-Jan-13 12:00pm
View
ok mike sir .. but i done code time checking but it won't work for checking specific time and specific day private void Form1_Load(object sender, EventArgs e)
{
if ((DateTime.Now.DayOfWeek== DayOfWeek.Saturday) &&(DateTime.Now.Hour==19) &&(DateTime.Now.Minute==15))
{
exportsqldatatoexcle();
emailattachment();
}
}
Atul Rokade
26-Jan-13 11:34am
View
mike sir im done that but not working in form load i done exctly what u told me but how to use windows task scheduler because after completing this application i'll install in client side so this time this window's task work fine?
Atul Rokade
21-Jan-13 12:01pm
View
this error come when i use timer function
Atul Rokade
21-Jan-13 12:00pm
View
Microsoft Office Excel cannot access the file 'E:\Winform n console\PhysioCure\PhysioCure\PhysioCure\Patient_Details.xls'. There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook. but im not doing any above thing now but then also this error come
Show More