|
i apollogized that here i am asking about Lucene.net in c# forum. i need some basic guidance about Lucene.net index technique before working with it.
below way people store or index their data by lucene.
var doc = new Document();
doc.Add(new Field("ID", oData.ID.ToString() , Field.Store.YES, Field.Index.NOT_ANALYZED));
doc.Add(new Field("Title", oData.Title, Field.Store.YES, Field.Index.ANALYZED));
doc.Add(new Field("Description", oData.Description, Field.Store.YES, Field.Index.ANALYZED));
doc.Add(new Field("Url", oData.Url, Field.Store.YES, Field.Index.ANALYZED));
writer.AddDocument(doc);
i like to know what is the meaning of Field.Store.YES, Field.Index.ANALYZED & Field.Index.NOT_ANALYZED
if we say Field.Store.NO then what will happen and when people should writeField.Store.NO. please give a example that when we should not store? if anything is not store in lucene index file then we can pull that data or can not search data by that field.
what is the meaning of Field.Index.ANALYZED and Field.Index.NOT_ANALYZED ? what happen when we say ANALYZED or not ANALYZED ? explain with example what actually lucene does when it encounters ANALYZED or not ANALYZED and Field.Store.NO & Field.Store.YES ?
tbhattacharjee
|
|
|
|
|
Tridip Bhattacharjee wrote: i apollogized that here i am asking about Lucene.net in c# forum If only there was some documentation[^] written about this already.
|
|
|
|
|
Could someone explain to me each line of the following code of what the code does as well as the overall functionality created:
string attempt;
attempt = My_Dialogs.InputBox("Enter your password"); while (attempt != "basic")
{
MessageBox.Show("Wrong! - try again.");
attempt = InputBox("Enter your password"); }
MessageBox.Show("Welcome to the program!");
Thanks
|
|
|
|
|
Indeed I could, but as I already know how this works and you don't, neither of us would really learn anything. What you could do, however, is put a breakpoint in here and play around with some of the inputs to see what effect this has. Ultimately, you're trying to get to the point where you see a MessageBox that states Welcome to the program!, but this is dependent on you entering a password of basic in an input box, so if you put a breakpoint on the first line (F9 in Visual Studio) and run the program under debug mode, you'll be able to see what effect each line has. To step over lines, use F10 (this executes the current line and advances you to the next logical statement).
Good luck.
|
|
|
|
|
Hi All,
I develop a POS windows Application and I use a POS printers with cash drawers,
my question is how to send a command to the printer to open the cash drawer without print the receipt.
Also how to send a command to the printer directly.
Thank you All
|
|
|
|
|
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>
|
|
|
|