|
Firstly, create new class name'myconstant'
public static string Format_ decimal= "0.00";
now you will create new class name 'myUtility'
public static string Format_ThousandSeparator(Decimal Val)
if (Val == 0) return myconstant.Format_decimal;
string l_val = Val.ToString(myconstant.Format_decimal);
if (l_val.Length < 5) return l_val;
return Val != 0 ? string.Format("{0:0,0.00}", Val) : myconstant.Format_decimal;
now you can this method
string mydec = myUtility.Format_ThousandSeparator(Convert.toDecimal(Textbox.Text));
|
|
|
|
|
This is a question answer forum and not the right location to place coding tricks.
Create a Tip / Trick instead[^].
|
|
|
|
|
Hi,
I am trying to connect with analysis services (SSAS) using VS2005 code behind with Microsoft.AnalysisServices.Xmla.XmlaClient.Connect(server name/IP) and its working if both web server and SSAS server are in same machine, but when I am trying to access remote server to connect with SSAS its giving me "A connection cannot be made. Ensure that the server is running.".
I think its because SSAS only works with windows authentication.
My requirement is to connect with SSAS with VS2005 code behind and after that create new SSAS DB using XMLA script, also I have to process the ASDB.
Does anyone have any thoughts on this??
Thanks,
Krishna
|
|
|
|
|
Hi,
I have three tables, Retro, Employer and Employer_Address, Retro is having employer id as foreign key. And for one retro id (345) there are 11 different Employers associated.
When I wrote the following query it is retieving 11 employer objects but every object is same (means all 11 objects are filled with employer 0 only, actually they should be eomployer0 to employer10).
Please help me with resolving this please.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
You missed out the query.
|
|
|
|
|
Sorry I wrote the query now
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
As Pete mentioned, you left out the query. If you could provide the query that you are using, it can help people help you out
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hey sorry guys, I was going for team lunch I was in hurry sorry for that here is my query I want to get all the references as they are in database, I dont know why am I getting it like that.
Dim rts As List(Of retro) = (From rt In context.retroes.Include("employer") Where rt.retro_id.Equals(retro_id)).ToList()
Here how they are referenced in database
Retro Id Employer Account No
----------------------------------
345 12345000
345 12345001
345 12345002
345 12345003
345 12345004
345 12345005
345 12345006
345 12345007
345 12345008
345 12345009
345 12345010
But it is giving all 11 references filled with only 12345000
Please help me in resolving it.
Thanks in advance.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
indian143 wrote: Where rt.retro_id.Equals(retro_id)).ToList()
Wouldn't this just point back to the first record? This is just my first glance at the problem. Shouldn't there be some join between the retro table and the employer table, specifically with the retro_id field?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I have page that displays the content either in english or french. Every thing works fine with english, but when the french text is displayed I am getting script errors (expected ')'...).
I have tried the following, which did not work
CodePage="65001" (in the page directive) and
<% Response.Charset = "utf-8"; %>
Cheers
CNU
|
|
|
|
|
Can you post the code? It's hard to guess where the error is without code.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
This is how it goes
in page_load()
System.Web.UI.WebControls.Label lblHint = new System.Web.UI.WebControls.Label();
lblHint.ID = "LABEL_HINT_" + ControlID;
lblHint.Text = " ? ";
lblHint.Font.Bold = true;
lblHint.BackColor = Color.LightYellow;
lblHint.ToolTip = "Click here to see Hints about this field";
lblHint.Attributes.Add("onmouseover", "javascript:this.style.cursor='hand'");
lblHint.Attributes.Add("onclick", "javascript:alert('" + Hint + "');");
pnlInputControlsHolder.Controls.Add(lblHint);
private string MakeFieldHint(DataRow drFieldDef)
{
string Hint = string.Empty;
if (this.GetLanguageOptionCookie().IndexOf(Constants.LANGUAGE_FRENCH) != -1)
{
if (drFieldDef["AllowCSL"] != DBNull.Value && Convert.ToBoolean(drFieldDef["AllowCSL"]))
Hint += "<br />You can enter multiple values separated by ,(comma).";
if (drFieldDef["AllowWildCard"] != DBNull.Value && Convert.ToBoolean(drFieldDef["AllowWildCard"]))
Hint += "<br />You can enter full or partial values.";
if (Hint != string.Empty)
Hint = "Field Name : " + Convert.ToString(drFieldDef["DisplayName"]) + "" + Hint;
}
else
{
if (drFieldDef["AllowCSL"] != DBNull.Value && Convert.ToBoolean(drFieldDef["AllowCSL"]))
Hint += "<br />Vous pouvez entrer plusieurs valeurs séparées par des virgules (,).";
if (drFieldDef["AllowWildCard"] != DBNull.Value && Convert.ToBoolean(drFieldDef["AllowWildCard"]))
Hint += "<br />Vous pouvez entrer des valeurs totales ou partielles.";
if (Hint != string.Empty)
Hint = "Nom de domaine : " + Convert.ToString(drFieldDef["DisplayName"]) + "" + Server.HtmlDecode(Hint);
}
return Hint;
}
Cheers
CNU
|
|
|
|
|
Put a breakpoint on the assignment to the "hint" variable; it's complaining about a ")", but that should not matter much to the assignment. There's a quote too much at the end of the string, but I guess that's a copy/post error from the IDE->website.
Next, I'd suggest splitting the assignment of the hint, and adding the Server.HtmlDecode over two lines. As they're now, they're a single line, making debugging a bit harder (since you can't see the intermediate result)
Could it be that the "virgules (,)."-part of the constant string is causing the extra ")"?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
We are facing some strange issue with Sybase while using with .net application. Some time we get exceptions like below:
• Column referenced (display_name) does not exist
• Column referenced (asp_permission) does not exist
• Column referenced (ss_state) does not exist
• etc
Whereas all columns are available and it works properly, however some time its stared throwing above exceptions,
Apart from above issue , one more issue is very frequent, below is the details.
• If we are calling a stored procedure from the ASE ADO.NET Data Provider, that contains "print" statements, an AseException occurs. For example, if you call the store procedure, which contains many print statements, we will receive an AseException.
Below are the steps we follow to use Sybase 15.7 with ADO.Net :
1. We upgraded our Sybase database from Sybase 12.5.1 to Sybase 15.7.0
2. We are using Sybase ADO.Net Driver of Sybase “Sybase.AdoNet2.AseClient” with Version : 2.155.1015.0 Runtime version : v2.0.50727
3. We are using this assembly from Global Assembly cache.
4. Platform for application in Development :
• Windows XP 32 bit,
• Microsoft Visual Studio .Net 2010
• .Net Framework 4.0
• Sybase Client 15.5
5. Platform for application in Test Server :
• Windows Server 2008 64 bit
• Microsoft Visual Studio .Net 2010
• .Net Framework 4.0
• Sybase Client 15.5
6. When we run database in Compatibility mode with Sybase 12.5.1 its works fine.
|
|
|
|
|
Chances are that this is a Sybase-specific problem. Have you tried their forums/support?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi Eddy,
Thanks for reply.
I have posted to lot of Sybase forums as well. still did not get any reply
Regards
Hirdesh
|
|
|
|
|
Still nothing?
If it looks like there's "little to no support", then it might be wise to consider a different database-provider.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi All,
I have an ASP.Net applicaiton in which I am using Entity Framework, I have a table (table1) which is referencing two of its columns from two different tables (table2 and table3). When I am trying to load table1 from entity frame work its not loading the values of table2 and table3. I know I have to put include in Linq statement but I am not sure how to handle for the two foreign keys. How can I put the Linq to handle two foreign keys.
Is there any separate way to get handle two Foreign Keys the Entity Framework.
Please help me in accomplishing this task, its an urgent requirement.
Thanks in advance.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
modified 7-Sep-12 3:44am.
|
|
|
|
|
indian143 wrote: its an urgent requirement.
We're volunteers, it ain't important to us.
indian143 wrote: I know I have to put include in Linq statement but I am not sure how to handle for the two foreign keys.
Not an include, but a JOIN statement[^].
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I have several asp:GridView in my project. How can I group common functionality such us...rowEditing etc
|
|
|
|
|
byka wrote: How can I group common functionality such us...rowEditing etc
Mostly, you cannot group them as each edit will have their own logic and queries. If you can try to make it close to generic if you have a similar structure.
|
|
|
|
|
What u really want to do with gridview ?
|
|
|
|
|
in asp.net.. in Gridview i created "Download" and "View" Button field.. how can i view the pdf file when i click ti view button as well as how can i download when i klick this download button..
|
|
|
|
|
hammathMuneerul huda wrote: how can i view the pdf file when i click
hammathMuneerul huda wrote: how can i download when i klick this download button
No need to provide two separate links. Single link 'View', on click of which you need to launch the file with Process.Start , it will automatically prompt a dialog asking to Open or Save it. User can do whatever they want.
Process.Start("filePath with name");
P.S.: Next time avoid making the whole question bold.
|
|
|
|
|
i am developing a project in which admin uploads the testimonials in database.
for this i have created a table in database and testimonials are stored in column "descr" of table "test".
now i want to fetch all the testimonials one by one on the home page in a marquee.
i am able to retrieve only first id value means only one testimonial in a marquee, but i want to upload all the testimonials one after another in a marquee.
can anybody please help
Jasbeer Singh
.Net Developer
|
|
|
|