|
Please do not cross post. As mentioned on the other one, I have never seen a tool that can do this since there are many ways that files can be referenced. You'll have to do it manually.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hello All,
I'm struck in Editing equation(which is added as an image from the Equation editor) in richtexbox.Does anyone knows any freeware equation editor which provides the equation editor contents to be stored as XML and which can be loaded into Richtextbox and then edited as text in richtextbox.
Thanks,
Avinash
|
|
|
|
|
|
Hi,
I have added a dropdownlist for qualification.
The dropdownlist text and its value is diffrent. Which is as follow.
Like
Text Value
BA 3
Bcom 3
BCA 3
BSc 3
MA 5
MSc 5
MCOM 5
When I run update query it is not giving desired result.
if(!IsPostBack)
{
string UserName = Session["SUSERNAME"].ToString();
SqlConnection con = new SqlConnection("Data Source=AI-PC;Initial Catalog=db*******ony;uid=mahuri_admin;pwd=fr******68");
con.Open();
SqlCommand com = new SqlCommand("update tblRegistration set Qualification='" + Qualification_DropDownList.SelectedItem.Text + "' ,Qualification_Point='" + Qualification_DropDownList.SelectedValue.ToString() + "' where username='" + UserName + "' ", con);
com.ExecuteNonQuery();
con.Close();
lbl_Message.Visible = true;
}
What the Problem I am facing suppose I select BSC as qualification to update.
After clicking Update button when the page reloads the first text with the value 3 (BA) get selected and the BA is updated in database instead of BSC.
Please help me.
|
|
|
|
|
Your code is susceptible to SQL Injection[^]. Update it to use a parameterized query:
using (SqlConnection con = new SqlConnection("..."))
using (SqlCommand com = new SqlCommand("UPDATE tblRegistration SET Qualification = @Qualification, Qualification_Point = @Qualification_Point WHERE username = @UserName", con))
{
com.Parameters.AddWithValue("@Qualification", Qualification_DropDownList.SelectedItem.Text);
com.Parameters.AddWithValue("@Qualification_Point", Qualification_DropDownList.SelectedValue);
com.Parameters.AddWithValue("@UserName", UserName);
con.Open();
com.ExecuteNonQuery();
}
As to why you're updating the wrong qualification, the problem is that your DropDownList contains items with the same value. When the form is posted back to the server, only the value of the selected item is sent - for example, "3". The server has no way to determine which item with the value "3" was selected, and so it chooses the first one.
The only way to fix the problem is to ensure that each item in the list has a unique value. That means you'll need to get the points from somewhere else - probably using the same source that you're currently using to populate the list.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi.
Ive been given a project to change crystal reports into bitmap format.
Please do help!!
|
|
|
|
|
That makes no sense. Crystal Reports are for creating printed reports. What does that have to do with bitmaps?
|
|
|
|
|
Hm, rather than printing the reports he wants to send them per email in the form of bitmaps. You can open bitmaps on virtually any system, can't you? That means less harm to trees.
|
|
|
|
|
Bernhard Hiller wrote: rather than printing the reports he wants to send them per email in the form of bitmaps. I don't see that in OP's question.
|
|
|
|
|
As Bernhard pointed out, it makes sense in very specific use cases (which the author didn't mention, but they don't matter to answer the question, IMO). Imagine you create the Crystal Report on a System but want to send it somewhere where neither PDFs nor Crystal Reports work (for whatever reason it may be). Still, your argument remains valid, but remember that we can't read the OPs mind and there might in fact be a use case (unimaginable to us) giving his question sense.
The console is a black place
|
|
|
|
|
Yes, and there might be a million other things in his/her mind. So what? My response was an attempt to get OP to explain in clear terms what they were trying to achieve.
|
|
|
|
|
Marco Bertschi wrote: Imagine you create the Crystal Report on a System but want to send it somewhere where neither PDFs nor Crystal Reports work (for whatever reason it may be
Keep in mind that the system wouldn't be able to support HTML either, because that is another possible output type.
So what sort of system doesn't support html but does support bitmaps? One of course might also wonder if this limited system only supports one type of bitmap.
|
|
|
|
|
jschell wrote: So what sort of system doesn't support html but does support bitmaps?
A system which is hardened down to meet some specific requirement defined by the customer, e.g. the customer doesn't want to have a browser installed?
The console is a black place
|
|
|
|
|
Marco Bertschi wrote: the customer doesn't want to have a browser installed?
Then they must be using a bit map viewer? Which would have its own limits?
|
|
|
|
|
Exactly. And since there was no mention of: number of pages; page size; etc.... It is rather premature to suggest solutions (to a poorly defined requirement).
I was once asked to send some (electronic) ascii text reports in a "larger font" because the final recipient didn't "see too well". Instead, I suggested they change the font size on their "viewer".
|
|
|
|
|
Probably the easiest way for you to do this would be to install an image printer[^] driver, and print to that rather than the default printer.
|
|
|
|
|
Damn. You were faster
Anyways, if he doesn't want to buy the ZAN license he could still use a free tool. We live in great times with loads of cool free stuff out there.
The console is a black place
|
|
|
|
|
As far as I'm concerned, Crystal Reports are designed to be printed out to whatever format, the format usually being a PDF or classic paper - I'm with Richard on this. Nowadays, we as Developers are in the lucky situation that a lot of freeware is out in the internet.
My approach would be to get a virtual printer driver which allows you to print a bitmap image ( instead of a physical piece of paper, or a PDF ) and then 'print' your report with this virtual printer. Of course this leads to the question if you don't want to print a PDF instead, if it is for the viewability of the report on different systems. If you want to use the report in a program which can't display Crystal Reports (for whatever reason it may be) stick with the Bitmap printer.
I had a quick look around, and found a few Bitmap virtual printers which I'd try out if I was you:
- ZAN Image printer [^] {Commercial License!}
- Virtual Image Printer Driver[^] {GPLv2}
The console is a black place
|
|
|
|
|
Consider this code:
public static T ConfigSetting<T>(string settingName)
{
return
} I already know it's not possible, because the caller needs to specify the type, but I want to know if there are other ways to achieve what I want, or if I have overlooked something simple.
|
|
|
|
|
try something like
T result = (T) CodeToRetrieveTofTheRightTypeDependingOnASettingInConfig();
return result; --edit
ehr.. wait, what?
Yes, see here[^]. May require you create a new overload for each type of constraint.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: a new overload for each type of constraint
That would probably work, even if it partly defeats the purpose with generics. But at least the calling methods would work like intended and receive the right type.
|
|
|
|
|
|
It's not the conversions I have a problem with.
I believe Eddy had the solution, even if it's not as elegant as I had wished for.
But I like the parsomatic.
|
|
|
|
|
This is exactly the problem that the Factory pattern was created to solve. If you want to get really fancy, you could use the Provider pattern.
|
|
|
|
|
That's actually what I'm trying to do, but while using generics.
I'm probably overdoing it.
<edit>I certainly had my head screwed on the wrong way yesterday, what I was trying to do is certainly not possible.
Factory it will be.</edit>
modified 2-Oct-14 3:44am.
|
|
|
|