|
Your question makes no sense. Your todate is later than your from date, I assume this is a typo. I assume your report is returning exactly what you asked for. You seem to be saying that you want to show dates even if the employee was not there, then. So, you need to write code that will do that. I'm not sure what sort of response you were expecting, we can't fix your code without seeing it, and it's obvious that you need to change how the code works to get the date range the way you want it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I am assuming you are looking for a query (and therefore this should have been asked in the General Database forum) in sql.
Select the dates between 1/sep and 9/sep (probably insert then into a table variable would be easiest) then do a left join from the date table to your timereport table, this will show all the dates and the attendance records.
|
|
|
|
|
in a DataGridView can each row bind to a different custom data source ((BindingList)) ?
|
|
|
|
|
No. The point of a databound control is to bind to a data source. You'd have to create a custom data source that grabbed data from the different sources you want to use.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
1) first, i think it's possible to bind a row, but i have not used;
2) why not to use 'for' loop to set row's value.
modified 27-May-14 5:30am.
|
|
|
|
|
Hi,
I have a project in 3 tier Architecture structure. There are GUI (presentation layer), BLL (Business logic layer) and DAL (Data Access Layer). Based my understanding dll always stick to exe in order to run my program. 3 tier is good in development management and enhancement.
Here is my question is it is any way to make my “dll” store application server (computer / App server) and user only keep the “exe”
e.g. hardware “–“ (link)
DB (Database server) – DLL(Application server, which is store the dll only) – EXE (multiple user, which is store exe only)
I used on Assembly Configuration Files. But it’s only help on probing those dll in subsidiary folder only. And it is FAIL probing to network path.
COM+ I added all dll in server application. It can be work if exe is running stand alone. But It is fail while user (user’s COM+ added the dll for his/her computer but point to server dll folder) run the exe in stand alone.
It is possible the exe can be run in a pc which is can refer the dll to application server? Purposely to separate my “dll” and “exe” is easy for me to do updating (Business logic changes only) hence I no need to update all users versions pc by pc.
Please give me a solution. Thank you.
|
|
|
|
|
Member 2321293 wrote: Here is my question is it is any way to make my “dll” store application server (computer / App server) and user only keep the “exe”
No. You can make your actual database anywhere you like, but the dll is the code to access that database. The user needs it. Unless you can distribute it on a local network with something like COM+, as you say. It still sounds dodgy to me.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
One possible solution is to implement Service layer above BLL code and DAL code. This service layer will wrap methods from these two assemblies in web service methods or WCF methods. By this, you can deploy different app layers on different machine. Additionaly, implementing Load balancing on application layer will not be a problem.
The service layer will represent nice interface for your exe to be used.
Let me sketch your scenario...
Presentation layer (EXE)
------------------------
BLL WCF Services
------------------------
BLL assembly
------------------------
DAL WCF Services
------------------------
DAL assembly
Your exe will reference BLL WCF service that can be deployed on any PC.
Your BLL code will reference DAL WCF service that can also be deployed on any PC.
I hope it will clear some issues for you.
|
|
|
|
|
So i need to come out a new Layer which is call service layer(WCF)?
Can give me a clear direction what is the WCF structure look like?
Thank you,
|
|
|
|
|
|
Hi,
After get your reply i try to come out a simple things. exe is a screen contain a button.
if i click on the button a message should be return from the layer call MyMessage.
i try to put MyMessage in IIS and MyInterface is the layer to communicated within this 2 layers.
my sample program
MyWCF(exe), MyMessage(BLL), MyInterface(WCF)
I still fail. maybe is due to IIS setting or the post problem
or maybe is the endpoint problem. i alway get a error message like bellow.
{"You have tried to create a channel to a service that does not support .Net Framing. It is possible that you are encountering an HTTP endpoint."}
and
The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.
My setting of my config file
<system.servicemodel><client>
<endpoint address="net.tcp://localhost:80/myHost/MyMessage" binding="netTcpBinding"
="" contract="myInterfaces.ImyMessage" name="MyMessage">
By the way, is this idea help in the speed performance? user, App.Server and DB.Server
modified on Sunday, September 13, 2009 11:12 PM
|
|
|
|
|
I want to have a dropdown combo box with a list of font sizes(point size) for the user to select from. The combo box is to be like that used in MS word etc.
Is there a way to do this for any c# built in call or should I create the list myself by supplying the values to the combo box.
Regards
Jeff.
|
|
|
|
|
You could at least search the CP articles before asking, even if you do nothing else!!
FontComboBox - a font listing combo box for .NET[^]
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Does this article somehow work out what font sizes are valid tho ? I googled, and it seemed to me that you couldn't work that out, so I didn't reply ( because I figured that someone else may know a way that I could not find )
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
It was late, I was tired, what can I say. My eyes totally skipped the size part of the question.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
There is no "list of system font sizes" A font is size independant - you can use it at anny size you want 8, 8.25, 400, 73. You list box should just contain common sizes, and allow the user to select uncommon ones.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Thank you for this info. I know what I need to do now.
|
|
|
|
|
What that would appear true in theory, not all fonts can be rendered at all point sizes. For example, consider a Label "label1" with initial font "Microsoft Sans Serif" at point size 8.25.
Font f = new Font(label1.Font.FontFamily, label1.Font.SizeInPoints + 0.5f);
label1.Font = f;
label1.Text = label1.Font.SizeInPoints.ToString();
Execute that code a few times (at least on my WinXP machine) via a button click or whatever, and the font's appearance at 9.25 and 9.75 are identical, as are 10.75 and 11.25, etc.
Also, there is obviously some mapping going on, setting the font size to 8.0 results in 8.25, 10.0 to 9.75, etc.
Is there any way of knowing, short of trial and error, if changing the point size by some amount will actually have impact on what is rendered?
|
|
|
|
|
it's very easy.
C# code
//get system fonts
InstalledFontCollection MyFont=new InstalledFontCollection();
FontFamily[] MyFontFamilies=MyFont.Families;
int Count=MyFontFamilies.Length;
for(int i=0;i <Count;i++)
{
string FontName=MyFontFamilies[i].Name;
this.comboBox1.Items.Add(FontName);
}
of course,I remember Win32 API have the funcation to get them.
modified 27-May-14 5:30am.
|
|
|
|
|
Hi.
My system has two USB printers .
I gonna print a document on the first printer and another document on the other one with a WinApp and C#.
Could you please guide me , how I can choose destination printer with C# ?
Thanks a million.
|
|
|
|
|
Try here[^].
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
First you have to find all installed printers, and then implement your code logic for selecting appropriate one's for printing the documents.
using System.Drawing.Printing;
// Loop through the string collection of printers
foreach (string strPrinter in PrinterSettings.InstalledPrinters)
{
// Show the name of the printer
MessageBox.Show(strPrinter);
}
By this you will have access to all installed printers. Implement your logic for selecting printer to do the job.
|
|
|
|
|
Hello to every body.
My name is Christian and i´m not a c# developer (I´m a VFP developer) but some how i manage to built a little UDP server listener app in c#.
I needed to do this becouse I will have several vehicles that send a data via GPRS to the server each minute and the server should be listening and decode the data to store in the database (MySql). There will be hundreds of entries per minute. I Hope that somebady can tell me if my code is multithread or not and if it´s not, how can i implement it. Also, if i need multithread in the database part. The code is this:
using System;
using System.IO;
using System.Net.Sockets;
using System.Net;
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.Xml;
using System.Data.Odbc;
using System.Data.OleDb;
using System.Threading;
namespace httprequest
{
public partial class udp : Form
{
private delegate void SetTextCallback(string text);
private delegate void SetValCallback(int val);
public udp()
{
InitializeComponent();
}
int i;
Socket soc;
const int bufsize = 1024;
byte[] buf = new byte[bufsize];
string szData;
private void button1_Click(object sender, EventArgs e)
{
try
{
i = 0;
IPEndPoint localIP = new IPEndPoint(IPAddress.Parse(this.textBox2.Text),Convert.ToInt32(this.textBox1.Text));
EndPoint epSender = (EndPoint)localIP;
soc = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
soc.Bind(localIP);
soc.BeginReceiveFrom(buf, 0, buf.Length, SocketFlags.None, ref epSender, new AsyncCallback(OnReceive), epSender);
this.button1.Enabled = false;
this.richTextBox1.Text = "Waiting for DataPacket...";
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "SGSServerUDP", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void SetText(string text)
{
if(i == 0)
{
this.richTextBox1.Clear();
i = 1;
}
this.richTextBox1.Text += text;
this.richTextBox1.Text += Environment.NewLine;
this.richTextBox1.SelectionStart = richTextBox1.Text.Length - 1;
//this.richTextBox1.ScrollToCaret();
if (text != null)
{
string[] geoValues = text.Split(new char[] { ',' });
if (geoValues.Length > 0 && geoValues.Length == 36)
{
string GeoResponse = geoValues[0].Substring(1, 4);
if (GeoResponse == "unit")
{
string unit = geoValues[0].Substring(6);
string reason = geoValues[7].Substring(7);
string eventid = geoValues[8].Substring(8);
string longitude = geoValues[11].Substring(10);
string latitude = geoValues[12].Substring(9);
string gps_valid = geoValues[14].Substring(10);
string gps_connected = geoValues[15].Substring(14);
string velocity = geoValues[17].Substring(9);
string emergency = geoValues[19].Substring(10);
string door = geoValues[21].Substring(5);
string datetime_actual = geoValues[34].Substring(16);
DateTime UTC = Convert.ToDateTime(datetime_actual);
DateTime LOCAL = UTC.ToLocalTime();
string datetime_actual1 = LOCAL.ToString("yyyy/MM/dd HH:mm:ss");
if (eventid != "0" && reason == "4")
{
conexion con = new conexion();
con.InsertRow(unit, reason, eventid, longitude, latitude, gps_valid, gps_connected, velocity, emergency, door, datetime_actual1);
con.closingcon();
}
}
}
}
}
private void WaitForData()
{
IPEndPoint localIP = new IPEndPoint(IPAddress.Parse(this.textBox2.Text), Convert.ToInt32(this.textBox1.Text));
EndPoint epSender = (EndPoint)localIP;
soc.BeginReceiveFrom(buf, 0, buf.Length, SocketFlags.None, ref epSender, new AsyncCallback(OnReceive), epSender);
}
private void OnReceive(IAsyncResult ar)
{
try
{
IPEndPoint ipeSender = new IPEndPoint(IPAddress.Any, 0);
EndPoint epSender = (EndPoint)ipeSender;
int iRx = 0 ;
iRx = soc.EndReceiveFrom(ar,ref epSender);
char[] chars = new char[iRx+1];
System.Text.Decoder d = System.Text.Encoding.UTF8.GetDecoder();
int charLen = d.GetChars(buf, 0, iRx, chars, 0);
szData = Encoding.Default.GetString(buf, 0, buf.Length);
string text = szData;
if (this.richTextBox1.InvokeRequired)
{
SetTextCallback f = new SetTextCallback(SetText);
this.Invoke(f, new object[] { text });
}
WaitForData();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "SGSServerUDP", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void udp_Load(object sender, EventArgs e)
{
String strHostName = "";
strHostName = Dns.GetHostName();
IPHostEntry ipEntry = System.Net.Dns.GetHostByName(strHostName);
IPAddress[] addr = ipEntry.AddressList;
for (int i = 0; i < addr.Length; i++)
{
this.textBox2.Text = addr[i].ToString();
}
}
private void button3_Click(object sender, EventArgs e)
{
this.richTextBox1.Clear();
}
}
}
|
|
|
|
|
this is codes from web:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace BroadcastExample
{
public partial class Form1 : Form
{
delegate void AppendStringCallback(string text);
AppendStringCallback appendstringcallback;
//Port 51008
/// <summary>
///
/// </summary>
private int port = 51008;
/// <summary>
///
/// </summary>
private UdpClient udpclient;
public Form1()
{
InitializeComponent();
appendstringcallback = new AppendStringCallback(AppendString);
}
/// <summary>
///
/// </summary>
/// <param name="text"></param>
private void AppendString(string text)
{
if (richtextBox2.InvokeRequired == true)
{
this.Invoke(appendstringcallback, text);
}
else
{
richtextBox2.AppendText(text + "\r\n");
}
}
/// <summary>
///
/// </summary>
private void RecData()
{
udpclient = new UdpClient(port);
IPEndPoint remote = null;
while (true)
{
try
{
byte[] bytes = udpclient.Receive(ref remote);
string str = Encoding.UTF8.GetString(bytes, 0, bytes.Length);
AppendString(string.Format("From{0}:{1}", remote, str));
}
catch
{
break;
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
Thread mythread = new Thread(new ThreadStart(RecData));
mythread.IsBackground = true;
mythread.Start();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
udpclient.Close();
}
private void button1_Click(object sender, EventArgs e)
{
UdpClient myUdpclient = new UdpClient();
try
{
IPEndPoint iep = new IPEndPoint(IPAddress.Broadcast, port);
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(textBox1.Text);
myUdpclient.Send(bytes, bytes.Length, iep);
textBox1.Clear();
myUdpclient.Close();
textBox1.Focus();
}
catch (Exception err)
{
MessageBox.Show(err.Message, "Failed");
}
finally
{
myUdpclient.Close();
}
}
}
}
modified 27-May-14 5:31am.
|
|
|
|
|
|