|
This isn't really a C# question, it would have been better to post in the SQL forum, but:
One solution (the one I'd use is
- round the
Utc_time to the second, the rounding function you need depends whether you want to round up, down or to the nearest value - Group by the value from step 0, getting the count
|
|
|
|
|
I am doing hospital project(desktop application)
I am using SAP crytal reports for prescription & certificates.
Here is my code:
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load(@"D:\Paranjpe_Hospital\Paranjpe_Hospital\CrtlRpt_OPD_pres_gen.rpt");
cryRpt.SetDataSource(ds.Tables[0]); //check it by writing only ds
Print_All_Certificates opd_pres = new Print_All_Certificates();
opd_pres.crystalReportViewer_all_certificates.Refresh();
opd_pres.crystalReportViewer_all_certificates.DataBindings.Clear(); //check it
opd_pres.crystalReportViewer_all_certificates.ReportSource = cryRpt;
opd_pres.Show();
Here problem is that ,when I printing prescription,it is always showing 1st prescription.
So,everytime I have to click on > ("Go to last page") in cryatal report viewer then it shows current prescription & then I am printing it.
How can I print current prescription without clicking on > ("Go to last page") in cryatal report viewer?
Please tell me solution of this problem.
|
|
|
|
|
Did you fill that table with just the one record you want to print or did you fill it with ALL the perscriptions in the table? Hint, hint.
|
|
|
|
|
Yes. I filled that table with just the one record I want to print.
In other words I am saving one prescription as one record in a table.
|
|
|
|
|
Well, if that was the case, then you'd get your correct record. Either you're filling that datatable with all the records or your retrieving the wrong record in your SQL.
|
|
|
|
|
hello
Anybody ever capture HttpRequest from Fiddler or WinpCap, then reconstruct a HttpRequest object?
Does anybody knows how to do this?
Thanks
dev
|
|
|
|
|
what's the problem with that???
I don't quite see the so I just pasted below some code to create a webrequest...
var wr = (HttpWebRequest)WebRequest.Create(uri);
SetHeader(wr, "GET", new Dictionary<tring,string> { { "Content-Type", "x-text" }, ..});
if (stream != null && stream.Length > 0)
using(var ws = wr.GetRequestStream())
Copy(stream, ws, length);
...
public static void SetHeader(HttpWebRequest req, string method, Dictionary<string, string> headers)
{
req.Method = method;
foreach (var kv in headers)
{
var k = kv.Key;
var v = kv.Value;
switch (k)
{
case "User-Agent":
req.UserAgent = v;
break;
case "Host":
break;
case "Accept":
req.Accept = v;
break;
case "Proxy-Connection":
case "Connection":
req.KeepAlive = (v ?? "").ToLower() == "keep-alive";
break;
case "Referer":
req.Referer = v;
break;
case "Content-Length":
req.ContentLength = reqSrc.ContentLength;
break;
case "Content-Type":
req.ContentType = v;
break;
case "If-Modified-Since":
req.IfModifiedSince = DateTime.Parse(v);
break;
default:
req.Headers.Add(k, v);
break;
}
}
static void Copy(Stream src, Stream dst, int len)
{
var buff = new byte[1 << 12];
int nread = 0;
int toRead = buff.Length > len ? len : buff.Length;
while ((nread = src.Read(buff, 0, toRead)) > 0 && len > 0)
{
dst.Write(buff, 0, nread);
len -= nread;
toRead = buff.Length > len ? len : buff.Length;
}
}
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
no. i know and done too many times constructing HttpRequest object from a url
but this time, i have a text string captured from say Fiddler/WinPcap - I don't want to parse url, extract query string/cookies anually myself so my question really is - any free code where i can instantiate a HttpRequest by passing to it Http request in form of a string captured by WinPcap or Fiddler.
dev
|
|
|
|
|
hi guys..can someone help me how to send a message on smart bro using c#? how to do this? when someone send me a text, the smart bro will automatically reply to the text.. if the text is "citutu" the reply is "ok" and if is not, the reply is "wrong code" what should i do? please help me..any bits of help would be a great step ahead on my research.. thank you for reading this..
|
|
|
|
|
1. Learn basics of C#
2. Learn basics of network programming.
3. Learn the protocol that defines "smart bro"
4. Put 1/2/3 together to create code that does what you want.
5. Test 4 and fix problems.
I would suspect that you might also need to learn about windows services. But that depends on what you mean by "automatically".
|
|
|
|
|
thank you for the reply..actually, i already have some codes from the internet on how to send and receive messages..however, the smart bro show 3 ports, COM3, 4, and 5.. i dont know why..i tried to use all the ports but i havnt successfully connected the smartbro to my c#..this is really my actual problem, how to connect smart bro to my c#. i already know about serialport class and gsmcomm..but i still dont know why cant i access my smart bro...huhu
|
|
|
|
|
And you know what protocol is expected on the serial port to talk to that device?
Do you have other software which does talk to it? Or in other words how do you know that the device is even interacting at the hardware/driver level?
|
|
|
|
|
i dont know either..thanks for the reply..i think i need more time and research for this..i have tried using hyper terminal.but it doesnt work.. i cant interface my smart bro using hyper terminal..i dont know whats the problem but i have read articles that interfacing smart bro is possible..thanks again..
|
|
|
|
|
I need to create a server client system and though I have created several libraries for tcp/ip communications (sockets, named pipes) I want to buy a profecional component that can handle packages loss, message compression and low quality networking. I have see that remobjects are a nice implementation but I cannot find any reviews for the product. Have you ever used remobjects for a project or any other simular component for C#?
thank you
|
|
|
|
|
Nowadays all the hype goes to WCF (excellent if one overlook the horrible configuration stage)
And there is a great open source alternative: http://www.servicestack.net/[^]
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Thank you for your answer,
I haven't thought WCF as an alternative and I searched for it but I read that it's not good in networking oop but It's better for SOA. The WCF developer has a huge overhead of interfaces and classes just to make it transmit some objects and the documentation of TCP/IP WCF is not very good.
I'll check the opensource alternative but I most probably use RemObjects. My main concern is that I cannot find any ppl using them and I worry if they worth the money they costs.
|
|
|
|
|
I'm on holiday typing from my phone now...
isn't the "ip" (from tcp/ip) handling package loss for you?
unless you want to use UDP?
I think there is a code project article about wcf over UDP...
at any rate this problem has perfectly good and free solution, I don't see why you would have to pay anything for that...
wcf use soap messages (I.e. Extremely verbose XML) over http
so it heavy..
but this is just the default setting, you can use TCP connection and binary formatter in your configuration! And even compression too! Ni service change!!
but apparently servicestack is even more compact
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Can anyone pls help me with the same problem.
I have Stored the User's profile Image's filename in the database column Image.
And the image to a folder named UserImage.
Can anyone pls help me with the code to display the image of corresponding user to the repeater.
I tried the above code but not working.
Pls help me.
Its urgent.
thanks in advance.
|
|
|
|
|
Yasir887 wrote: Its urgent.
Not to us it isn't. Nobody here is paid to answer your questions; we do it because we enjoy helping other people.
Adding "it's urgent" to your question isn't going to make us help you any faster. In fact, it's more likely to make us ignore your question!
Yasir887 wrote: I tried the above code but not working.
What code? Did you forget to paste it?
Also, "not working" isn't enough information. How is it not working? Are you getting an error message? Is the output not what you expected?
Yasir887 wrote: I have Stored the User's profile Image's filename in the database column Image.
And the image to a folder named UserImage.
Can anyone pls help me with the code to display the image of corresponding user to the repeater.
What have you tried? The obvious approach is:
<asp:Image runat="server"
ImageUrl='<%# Eval("Image", "~/UserImage/{0}") %>'
/>
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Really sorry for the way in which i asked the question.
thanks for the code you had mentioned here . I tried the same thing. But not working.
Below is the code which i did.
In the aspx page:
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt = db.table("SELECT UserDetails.UserName, UserDetails.Image, Article.ArticleId, Article.ArticleTitle, Article.ArticleDescription, Article.ArticleDate FROM Article INNER JOIN UserDetails ON Article.UserName = UserDetails.UserName");
Repeater1.DataSource = dt;
Repeater1.DataBind();
}
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
{
string aid = Request.QueryString["aid"];
}
And the html side:
<asp:repeater id="Repeater1" runat="server"
="" onitemcommand="Repeater1_ItemCommand">
<HeaderTemplate>
</HeaderTemplate>
<itemtemplate>
<%#DataBinder.Eval(Container,"DataItem.ArticleTitle")%>
Posted by <%#DataBinder.Eval(Container,"DataItem.UserName")%> | on <%#DataBinder.Eval(Container,"DataItem.ArticleDate")%>
<asp:image id="Image1" runat="server" imageurl="<%# Eval("Image", "~/UserImage/{0}") %>">
<separatortemplate>
<footertemplate>
|
|
|
|
|
What output does the Image control generate? Can you access the URL from the src attribute directly?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Image control is blank now.
|
|
|
|
|
If the src attribute is blank, that means you don't have a value in the Image column.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you so much.. The problem you had mentioned is right... I got the desired result.. Thanks alot...
|
|
|
|
|
Richard Deeming wrote: "it's urgent"
OP automatically ignored here
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|