15,913,296 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 indiancodinglove (Top 28 by date)
indiancodinglove
11-Nov-13 23:38pm
View
I have a datagridview and some textboxes. when I am click on the add button then all values show in datagridview now I want to sum of scooter in a textbox and motorcycle sum of in other textbox and total amount of purchase in other textbox which is only view at that time when the program running if I am deleting sum row in gridview then sum of scooter,motorcycle,amount will be delete at the running time
indiancodinglove
11-Nov-13 20:58pm
View
ok sir problem solved. thanks
indiancodinglove
10-Nov-13 21:30pm
View
I received the error:"Unable to cast object of type 'System.Data.DataRow' to type 'System.Windows.Forms.DataGridViewRow'
when I am using this code
private void button1_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow dr in objDT.Rows)
{
txtInvNo.Text = dr.Cells[0].Value.ToString();
txtPG.Text = dr.Cells[1].Value.ToString();
// etc...
Add_PO_Details();
}
}
indiancodinglove
10-Nov-13 7:54am
View
if u don't mind ,
dear sir please tell me how to add datagridview values directly.
indiancodinglove
11-Oct-13 4:34am
View
Sir its working thanks a lot.
indiancodinglove
6-Oct-13 21:30pm
View
I am using sql2005 there is no option for date data type only datetime datatype.
indiancodinglove
6-Oct-13 8:54am
View
DateTime
indiancodinglove
6-Oct-13 2:30am
View
I also try this coding but not working
string query = null;
query = "select sum(txtPurity) from EntryTable where txtDate =@Date AND cmbItemType='" + cmbItemType.Text + "'";
SqlConnection conn = new SqlConnection(connstr);
SqlCommand cmd = new SqlCommand(query, conn);
cmd.Parameters.AddWithValue("@Date", txtDate.Value.Date);
conn.Open();
SqlDataReader sqlReader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
if (sqlReader.Read())
{
txtSumOfPurity.Text = sqlReader[0].ToString();
}
conn.Close();
indiancodinglove
6-Oct-13 1:35am
View
This query is working but when I am selecting less then txtDate its not give that date data.
it gives sum of all the field not that date of data.
query = "select sum(txtPurity) from EntryTable where txtDate > convert(datetime,'06-10-2013') AND cmbItemType='" + cmbItemType.Text + "'";
indiancodinglove
27-Sep-13 9:11am
View
private void Item_Load(object sender, EventArgs e)
{
Autocomplete();
}
private void Autocomplete()
{
//Autocomple Name here
try
{
string query = "Select distinct txtItemCode from ItemTable order by txtItemCode asc";
SqlConnection conn = new SqlConnection(connstr);
SqlCommand cmd = new SqlCommand(query, conn);
conn.Open();
SqlDataReader dReader = cmd.ExecuteReader();
AutoCompleteStringCollection namesCollection = new AutoCompleteStringCollection();
while (dReader.Read())
{
namesCollection.Add(dReader["txtItemCode"].ToString());
}
dReader.Close();
conn.Close();
txtItemCode.AutoCompleteMode = AutoCompleteMode.Suggest;
txtItemCode.AutoCompleteSource = AutoCompleteSource.CustomSource;
txtItemCode.AutoCompleteCustomSource = namesCollection;
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
indiancodinglove
25-Sep-13 2:59am
View
i am creating a window based application with c# and sql database.
indiancodinglove
23-Sep-13 5:16am
View
yes i am binding the data to gridview and show it to middle.
http://www.codeproject.com/Articles/196579/How-to-Print-Invoice-using-C
i am trying this code but in my code gridview and header are the same point not show it in the middle
private void ReadInvoiceHead() {
//Titles and Image of invoice:
InvTitle = "RAVI PRAKASH ";
InvSubTitle1 = "23,SABJI MANDI";
InvSubTitle2 = "DHAMPURAJK,BIJNOREDKJE";
InvSubTitle3 = "Phone -133444246346";
InvSubTitle4 = "Created By Indian";
InvImage = Application.StartupPath + @"\Images\" + "InvPic.jpg";
} private void SetInvoiceHead(Graphics g) {
ReadInvoiceHead(); CurrentY = topMargin;
CurrentX = leftMargin; int ImageHeight = 0;
// Draw Invoice image:
if (System.IO.File.Exists(InvImage)) {
Bitmap oInvImage = new Bitmap(InvImage);
// Set Image Left to center Image:
int xImage = CurrentX + (InvoiceWidth - oInvImage.Width) / 2;
ImageHeight = oInvImage.Height; // Get Image Height
g.DrawImage(oInvImage, xImage, CurrentY); }
InvTitleHeight = (int)(InvTitleFont.GetHeight(g));
InvSubTitleHeight = (int)(InvSubTitleFont.GetHeight(g));
// Get Titles Length:
int lenInvTitle = (int)g.MeasureString(InvTitle, InvTitleFont).Width;
int lenInvSubTitle1 = (int)g.MeasureString(InvSubTitle1, InvSubTitleFont).Width;
int lenInvSubTitle2 = (int)g.MeasureString(InvSubTitle2, InvSubTitleFont).Width;
int lenInvSubTitle3 = (int)g.MeasureString(InvSubTitle3, InvSubTitleFont).Width;
int lenInvSubTitle4 = (int)g.MeasureString(InvSubTitle4, InvSubTitleFont).Width;
// Set Titles Left:
int xInvTitle = CurrentX + (InvoiceWidth - lenInvTitle) / 2;
int xInvSubTitle1 = CurrentX + (InvoiceWidth - lenInvSubTitle1) / 2;
int xInvSubTitle2 = CurrentX + (InvoiceWidth - lenInvSubTitle2) / 2;
int xInvSubTitle3 = CurrentX + (InvoiceWidth - lenInvSubTitle3) / 2;
// Draw Invoice Head: if (InvTitle != "") {
CurrentY = CurrentY + ImageHeight;
g.DrawString(InvTitle, InvTitleFont, BlueBrush, xInvTitle, CurrentY);
} if (InvSubTitle1 != "") {
CurrentY = CurrentY + InvTitleHeight;
g.DrawString(InvSubTitle1, InvSubTitleFont, BlueBrush, xInvSubTitle1, CurrentY);
} if (InvSubTitle2 != "") {
CurrentY = CurrentY + InvSubTitleHeight;
g.DrawString(InvSubTitle2, InvSubTitleFont, BlueBrush, xInvSubTitle2, CurrentY);
} if (InvSubTitle3 != "") {
CurrentY = CurrentY + InvSubTitleHeight;
g.DrawString(InvSubTitle3, InvSubTitleFont, BlueBrush, xInvSubTitle3, CurrentY);
} // Draw line:
CurrentY = CurrentY + InvSubTitleHeight + 8;
g.DrawLine(new Pen(Brushes.Black, 2), CurrentX, CurrentY, rightMargin, CurrentY);
}
indiancodinglove
18-Sep-13 2:29am
View
Finally i have find the solution that UDP Port must be add with the TCP port.
Like TCP=1433,UDP=1434
http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/
http://blogs.msdn.com/b/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx
indiancodinglove
18-Sep-13 2:15am
View
only for my knowledge. i think why it is not working with the firewall option enable so i am trying.
indiancodinglove
18-Sep-13 1:40am
View
remote server
indiancodinglove
18-Sep-13 0:29am
View
thanks all
its working but one problem.
when i am off the firewall option then the connectivity is working fine data can be retrieve from the database if firewall option on (adding with port tcp=1433) then it show an error.
"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
indiancodinglove
17-Sep-13 9:18am
View
Yes sir its my mistake its working fine.
Thanks a Lot sir.
indiancodinglove
17-Sep-13 9:08am
View
it show the empty grid view (same date or selected different date)
indiancodinglove
17-Sep-13 8:51am
View
It Gives a error
"Property or indexer 'System.DateTime.Hour' cannot be assigned to -- it is read only"
indiancodinglove
17-Sep-13 8:18am
View
Sir Please tell me how to set the time.
indiancodinglove
17-Sep-13 7:52am
View
now i am use this query its give me right result is it ok?
string dt1 = dateTimePicker1.Value.ToString("yyyy.MM.dd");
string dt2 = dateTimePicker2.Value.ToString("yyyy.MM.dd");
string query = "select txtDate,txtCustomerName,txtAddress from EntryTable where Convert(varchar(10),txtDate,102) between '" + dt1 + "' and '" + dt2 + "'";
indiancodinglove
15-Sep-13 9:04am
View
its working but data not retrieving from the database.
indiancodinglove
15-Sep-13 8:26am
View
if i am using,
dataAdapter.SelectCommand.Parameters.Add("@myDate", new DateTime());
then its create a error
"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."
in prieveously, i am asking this question then one person give me answer that use the datetime.now when i am inserted this its run but data not show in the grid view when i am using below the query then all its work fine.
string query = "select txtDate,txtCustomerName,txtAddress from EntryTable where txtCustomerName='ABC'";
only problem in date.
indiancodinglove
15-Sep-13 5:26am
View
Breakpoint on the DateTime:
dt ={1/1/0001 12:00:00 AM}
then execute
then execute
then execute
when dataadaptor fill the table it show the error
"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."
string query = "select txtDate,txtCustomerName,txtAddress from EntryTable where txtDate=@myDate";
SqlConnection conn = new SqlConnection(connstr);
SqlDataAdapter dataAdapter = new SqlDataAdapter(query, conn);
DateTime dt = new DateTime();
dataAdapter.SelectCommand.Parameters.Add("@myDate", dt);
SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter);
DataTable table = new DataTable();
table.Locale = System.Globalization.CultureInfo.InvariantCulture;
dataAdapter.Fill(table);
indiancodinglove
15-Sep-13 4:12am
View
dataAdapter.SelectCommand.Parameters.Add("@myDate", new DateTime(15-9-2012,20-9-2013));
this is not working?
sir tell me how?
indiancodinglove
9-Sep-13 4:38am
View
Show an Error
Operator '&' cannot be applied to operands of type 'string' and 'string'
indiancodinglove
9-Sep-13 0:04am
View
thanks H.Brydon
indiancodinglove
8-Sep-13 23:47pm
View
any site which gives the best tutorial and you can ask any question.(c#)
Show More