|
This will depend on how the printer is connected, and to what, and the actual commands required by the device. You need to check the documentation for the printer as a first step.
|
|
|
|
|
Hi,
I Use wintec printer which connected to the PC Using USB Port, and the cash drawer connected to the printer directly.
|
|
|
|
|
As I said before, you need to check the documentation for the printer to see what commands it needs.
|
|
|
|
|
Soooooo you want other people to do your research for you? That's what I'm hearing from you.
|
|
|
|
|
I want to adding another component including timer.tick, progressbar and backroundworker, how do i adding the component to process mailsend and this is the code, thanks:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.Mail;
using System.Net;
namespace Mail_Send
{
public partial class Form4 : Form
{
SmtpClient obj_SMTPClient;
MailMessage Obj_MailMsg;
Attachment obj_Attachment;
public Form4()
{
InitializeComponent();
}
private void Form4_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog open = new OpenFileDialog();
if (open.ShowDialog() == DialogResult.OK)
{
label3.Text = open.FileName;
}
}
private void button3_Click(object sender, EventArgs e)
{
this.Close();
}
private void SendMail_Click(object sender, EventArgs e)
{
if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "")
{
MessageBox.Show("please fill, don't let a column blank!!!");
}
else
try
{
obj_SMTPClient = new SmtpClient("smtp.gmail.com");
Obj_MailMsg = new MailMessage();
obj_Attachment = new System.Net.Mail.Attachment(label3.Text);
Obj_MailMsg.From = new MailAddress(textBox1.Text);
Obj_MailMsg.To.Add(textBox3.Text);
Obj_MailMsg.Body = textBox5.Text;
Obj_MailMsg.Attachments.Add(obj_Attachment);
Obj_MailMsg.Subject = textBox4.Text;
SmtpClient smtps = new SmtpClient("smtp.gmail.com", 587);
obj_SMTPClient.Credentials = new NetworkCredential();
obj_SMTPClient.Port = 587;
obj_SMTPClient.Credentials = new System.Net.NetworkCredential(textBox1.Text, textBox2.Text);
obj_SMTPClient.EnableSsl = true;
obj_SMTPClient.Send(Obj_MailMsg);
obj_SMTPClient.EnableSsl = true;
obj_SMTPClient.Send(Obj_MailMsg);
MessageBox.Show("Message Successful sent!!!");
}
catch
{
MessageBox.Show("Sorry, Request TimeOut!!!");
}
}
private void button4_Click(object sender, EventArgs e)
{
}
private void button8_Click(object sender, EventArgs e)
{
foreach (Control sayre in this.Controls)
{
if (sayre is TextBox)
{
(sayre as TextBox).Clear();
}
}
}
private void button6_Click(object sender, EventArgs e)
{
}
private void button5_Click(object sender, EventArgs e)
{
}
private void button4_Click_1(object sender, EventArgs e)
{
foreach (Control sayre in this.Controls)
{
if (sayre is TextBox)
{
(sayre as TextBox).Clear();
}
}
}
}
}
modified 12-Jul-14 21:38pm.
|
|
|
|
|
|
I have a stored procedure that returns two resultset. I am calling this stored procedure in C# using EF 5.0. I have gone through the examples on this site as well as on thissite.
I can understand that it is comparatively easy to call multiple result set with EF 5.0. But I am confused on adding ReturnType on FunctionImport tag which is as below:
<FunctionImport Name="GetAllBlogsAndPosts">
<ReturnType EntitySet="Blogs" Type="Collection(BlogModel.Blog)" />
<ReturnType EntitySet="Posts" Type="Collection(BlogModel.Post)" />
</FunctionImport>
In the above example, Blog and Post are two different entities so can easily be referred. However, in my case, the two resultset is the result of joining of multiple tables. SO how will I specify a specific table name here? (On EntitySet as well as Type). I am not able to understand clearly what value should go into these tags? Please provide any help.
|
|
|
|
|
|
Thank you.
I have already referred this and I mentioned this in my question also. I asked the question because I am not able to understand how to refer multiple tables on FunctionImport and Return Types.
Anyway, I found out already. Thanks for your help.
|
|
|
|
|
I have a stored procedure that returns multiple result set. I tried to use Translate method to handle this, however, I am not able to call this method, as it is giving error such a method doesn't exist. I am using .Net Framework 4.5 and Entity Framework 5.0. Following is what I have tried.
using (var db = new MyEntities())
{
using (IDbConnection oaConnection = db.Database.Connection)
{
using (IDbCommand oaCommand = oaConnection.CreateCommand())
{
oaCommand.CommandType = CommandType.StoredProcedure;
oaCommand.CommandText = "gsp_get_emp_details";
oaCommand.Parameters.Add(empInput.EmployeeId);
oaCommand.Parameters.Add(empInput.UserId);
oaCommand.Parameters.Add(empInput.RoleList);
using (IDataReader dataReader = oaCommand.ExecuteReader())
{
EmployeeData empData = db.Translate<EmployeeData>(dataReader as DbDataReader);
}
}
}
}
I tried using by calling
using System.Data.Objects; , however it is giving compile error on db.Translate. It is giving the message that "project does not contain a definition for Translate...". May I know what's wrong with the above code? Thanks in advance for any help.
|
|
|
|
|
I'm pretty sure that you should be using Translate on an ObjectContext .
|
|
|
|
|
Thanks a lot!!!. I was using DBContext. I was little aware of ObjectContext. I done some examples now. This link is useful, hope it will be useful for someone.
This link also much useful how to get objectcontext references.
Thanks again..
modified 12-Jul-14 16:14pm.
|
|
|
|
|
Can someone tell me how to do that? There is tons of examples in the internet, but they don't cover self hosted WCF libraries. Please if anyone, share some code, bwt i need app.config configuration, and feature to enable CORS and REST
|
|
|
|
|
You might be best asking the specific WCF forum[^]
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
You can't have a self-hosted library. A library is something that is used by something else.
You need some sort of host - a process. Simplest thing to do is a simple console app.
Regards,
Rob Philpott.
|
|
|
|
|
no i can, start new wcf library template from visual studio, and you will have self hosted wcf, which plugs into windows wcf-hoster.
|
|
|
|
|
i create a s/w , by C# (visual studio) , at backend mySql. i create exe file which i create in visual studio.
so my Question is-
a)if i install the exe file in other computer then i have to install Mysql workbrench on that computer ?
b)if yes then how can i install it?
|
|
|
|
|
Don't post this in multiple places - it wastes time and annoys people.
You have it posted in QA, leave it there.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
No, you shouldn't have to. Presumably your exe is using MySQL 'driver' assemblies, so as long as they are distributed with your .exe you should be fine.
Regards,
Rob Philpott.
|
|
|
|
|
Hi
I need to populate a datatable with two fields from an xml file.<partnum> and <actualqtynum>
The file was obtained from a report that opens in a web browser, and the file saved from there.
DataTabel.ReadXml(XMLFilename) fails (complains about the ':' character in Line 2 of the xml file.)
I thought about using something like below, since I do have a complete list of the <partnum> in another table, but the <actualqtynum> is not a child node of <partnum> , and this also fails (complains about the ':' character in Line 2 of the xml file.)
public string GetKeyValue(string key)
{
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
xd.Load(_XMLFileName);
System.Xml.XmlNode Node = xd.DocumentElement.SelectSingleNode("/REPORTTABLE/REPORTTABLEDETAILS/PARTNUM add[@key=\"" + key + "\"]");
if ((Node != null))
{
return Node.Attributes.GetNamedItem("value").Value;
}
else
{
return null;
}
}
Any idea how I can get a list of PARTNUM with the corresponding ACTUALQTYNUM?
="1.0"="Shift_JIS"
="text/xsl"="../Bin/KITSCHREPFLEXA.xsl"
<DOCUMENT>
<REPORTHEADER>
<REPORTTIME>2014/07/11 13:36:44</REPORTTIME>
<CREATEBY>Fujiuser</CREATEBY>
<SCHEDULENAME>Week_23_2014</SCHEDULENAME>
</REPORTHEADER>
<REPORTTABLE>
<REPORTTABLEDETAILS>
<JOBNAMES><JOBNAME>260-C536000-PACE - Top_TLine 1 / Line 1 / Top / 1</JOBNAME></JOBNAMES>
<JOBNAMES><JOBNAME>260-C536000-PACE - Top_BLine 2 / VEK Line 2 / Bottom / 1</JOBNAME></JOBNAMES>
<DATANUM>38</DATANUM>
<PARTBARCODE>938-1030507</PARTBARCODE><ORIGINALPARTBARCODE>938-1030507</ORIGINALPARTBARCODE><PARTNUM>938-1030507</PARTNUM>
<SUPPLYNUM>2</SUPPLYNUM>
<ACTUALNUM>2</ACTUALNUM>
<REMAINSNUM>0</REMAINSNUM>
<QTYSUPPLYNUM>4</QTYSUPPLYNUM>
<QTYACTUALNUM>6249</QTYACTUALNUM>
<QTYREMAINSNUM>6245</QTYREMAINSNUM>
</REPORTTABLEDETAILS>
<REPORTTABLEDETAILS>
<DATANUM></DATANUM>
<PARTBARCODE>948-1025627</PARTBARCODE><ORIGINALPARTBARCODE>948-1025627</ORIGINALPARTBARCODE><PARTNUM>948-1025627</PARTNUM>
<SUPPLYNUM>2</SUPPLYNUM>
<ACTUALNUM>1</ACTUALNUM>
<REMAINSNUM>-1</REMAINSNUM>
<QTYSUPPLYNUM>40</QTYSUPPLYNUM>
<QTYACTUALNUM>6720</QTYACTUALNUM>
<QTYREMAINSNUM>6680</QTYREMAINSNUM>
</REPORTTABLEDETAILS>
|
|
|
|
|
|
Thanks for your reply Richard.
From W3.org it seems the file is possibly not 100% compliant
xml:stylesheet should be
xml-stylesheet
But even so, I eventually got hold of the stylesheet which did not have any Schema info.
Also tried DataSet.ReadXml as many posts on the net suggested where a schema was not available with no luck.
Ended up reading the file with StreamReader.ReadLine and picking out the values I needed with SubString(...)
|
|
|
|
|
Having to deal with defective XML files is always fun... My 5 for seeing that little difference.
Alternatively to your solution, write the file back line by line, just omitting the "bad" line. With that file, some tools could generate classes for its content, and thus making the access to the properties easier.
The Japanese encoding could cause some more fun later on, be prepared for that.
|
|
|
|
|
C# Code
using System;
using System.Collections;
namespace Loop_Test
{
public class ForLoopTest
{
static void Main()
{
int Ticks = 0;
int Bit = 0;
int Ask = 0;
int Bar1 = 22;
for(int i = 0; i < 22 ( Bit + Ask) ; i++)
Console.WriteLine("Bar1");
}
}
}
This is one of bar from 22 Ticks ,Stock bar chart (Bid,Ask,Open,High,Low, Close).
When bar close must have Variable (Bit&Ask) Total= 22;
Can somebody help me with this loop.
David.
|
|
|
|
|
A few things:
1) Do you want to loop until (Bit + Ask) = 22?
2) The value of Bit,Ask and Bar1 are not changing from 0
3) If you want to display the value of Bar1 then you should put Console.WriteLine(Bar1.ToString());
(Console.WriteLine("Bar1") will display 'Bar1' and not the value of the variable Bar1)
for (int i = 0; (Bit + Ask) < 22; i++)
{
Console.WriteLine(Bar1.ToString());
}
|
|
|
|