|
You have to check your input data. I think if you read a design pattern you can do this on better way. Say! your code is really horrible to understand. You have to try to use classes and generic collections if you want to manage your code.
But if you check your input data, you can find the wrong input data type or data length. Good luck!!!
|
|
|
|
|
iam having a grid data like this
Empno Ename Path
1 xyz x/y/z
1 xyz x/y/z
1 xyz x/y/z
in one case i dont want path column not to display in the grid it is easy that in grid rowdatabound cell(3)visible = false but it is a template field.so how can i hide the headertext and data column
|
|
|
|
|
Just Dont define it in the grid view means u will have a code like this
<asp:templatefield headertext="Id" sortexpression="Id">
<edititemtemplate>
<asp:label id="Label1" runat="server" text="<%# Eval("Id") %>" <="" asp:label="">
<itemtemplate>
<asp:label id="Label1" runat="server" text="<%# Bind("Id") %>" <="" asp:label="">
remove those according to your requirement
|
|
|
|
|
hi
i was little bit confused will u explain cleary tha why sort expression is needed
|
|
|
|
|
Hey i just posted that if in your project if you don't need any template go to the source part there you can edit your Grid view
|
|
|
|
|
hi
i m new to asp.net.I hav to show dashboard in my page.one dashboard has 9 images.so i m taking two tables and getting 6 images in one table and 3
images in second table to reduce scrolling.i m refreshing page after every 30 seconds. i m making visibility true/false alternatively on every refresh.its working fine.
but now i m having more than one dashboard.each dashboard hav refresh time attached with it.now i hav to dynamically change the dashboard after
fixed time interval.
e.g.
dashboard1 hav 9 images and 30 seconds
dashboard2 hav 9 images and 40 seconds
how to change this refresh time and dashboard dynamically
this information i hav in database
|
|
|
|
|
Use javascript timer or timer control in .net
|
|
|
|
|
Hello one and all,
I am having small requirement. I am having some data stored in SQL DB. I am displaying that data in a grid view as follows
Id Name Filename
1 Dorababu dora.doc
2 Khan khan.pdf
3 XYZ XYZ.jpg
all these filenames are displayed in link button inside grid view. What i need is when i click on particular name like .oc or .pdf or .jpg i would like to get the following thing as Open Save Cancel as we get when we are downloading an attachment from mail. Can an one give me the code for my requirement please.
Thanks in Advance,
M.Dorababu
|
|
|
|
|
Use filename in simple href tag.
|
|
|
|
|
Can you tell what to do actually my code is like this
<ItemTemplate>
<asp:LinkButton ID="Link1" runat="server" Text='<%# Bind("filename") %>' ></asp:LinkButton>
</ItemTemplate>
So can you tell what to do here
|
|
|
|
|
use a hyperlink instead of linkbutton and give the path of the file in its NavigateURL attribute.
Regards,
Kapil Thakur
(Where's there is Kapil , there is a way) - thakur.kapil@gmail.com
|
|
|
|
|
Hello all,
I want to insert a Hindi text value into a mysql5.1 database from an asp.net TextBox when a "INSERT" button is clicked. And I also want to retrive the same value from MySql5.1 to an asp.net TextBox when a "SHOW" button is clicked. Please help me how this will be possible. I am using Visual Studio 2005 and C# for code behind.
Thanks in advance
|
|
|
|
|
hi friends
In asp 2.0,we have File upload control,In this control allow to upload the multiple file (If you browse the button,Upload window will be open and select the multiple file into upload window..finally we upload the file)
In asp 1.1 ,we have html file upload control,here i need to open the upload window and select multiple file into upload window..finally upload the all the files..
but asp1.1,select single file only into upload window..i need to select more file into upload window
Is it possible?
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
Select File one by one using File Upload Control. Put a Add button on the form, OnClick of the Add button, add the file in a listbox. Add multiple file , then click on upload button to upload file taking the list from Listbox.
|
|
|
|
|
Exception Details: System.Web.HttpException: Request timed out.
I am using ReportViewer control.I have only problem in Exporting in PDF format.
I have made setting in web.config like
httpRuntime executionTimeout="900" in system.web tag
Also I have checked many attributes like sessionState,httpRuntime,httpCookies in web.config file. And also checked values for server.Scripttimeout.
Please tell me which setting can cause error while exporting the reports.
|
|
|
|
|
What is the report processing mode? Local or remote?
Regards
Saanj
Either you love IT or leave IT...
|
|
|
|
|
hiiiiiiii
i m using asp.net using c# i want to put numeric value in textbox and it will convert in to word,as i put 234 in textbox and it will convert in to two hundred thirty four.
plese help me
thanks in advance
|
|
|
|
|
|
This[^] will tell you everything you need to know.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
prateekfgiet wrote: want to put numeric value in textbox and it will convert in to word,as i put 234 in textbox and it will convert in to two hundred thirty four
So, what is your problem? Did you tired any thing?
|
|
|
|
|
ya i have tried a code but when code runs it will give error
code is :
string Number;
string deciml;
string _number;
string _deciml;
string[] US = new string[1003];
string[] SNu = new string[20];
string[] SNt = new string[10];
protected void Page_Load(object sender, EventArgs e)
{
Initialize();
}
public string NameOfNumber(string Number)
{
string GroupName = "";
string OutPut = "";
if ((Number.Length % 3) != 0)
{
Number = Number.PadLeft((Number.Length + (3 - (Number.Length % 3))), '0');
}
string[] Array = new string[Number.Length / 3];
Int16 Element = -1;
Int32 DisplayCount = -1;
bool LimitGroupsShowAll = false;
int LimitGroups = 0;
bool GroupToWords = true;
for (Int16 Count = 0; Count <= Number.Length - 3; Count += 3)
{
Element += 1;
Array[Element] = Number.Substring(Count, 3);
}
if (LimitGroups == 0)
{
LimitGroupsShowAll = true;
}
for (Int16 Count = 0; (Count <= ((Number.Length / 3) - 1)); Count++)
{
DisplayCount++;
if (((DisplayCount < LimitGroups) || LimitGroupsShowAll))
{
if (Array[Count] == "000") continue;
{
GroupName = US[((Number.Length / 3) - 1) - Count + 1];
}
if ((GroupToWords == true))
{
OutPut += Group(Array[Count]).TrimEnd(' ') + " " + GroupName + " ";
}
else
{
OutPut += Array[Count].TrimStart('0') + " " + GroupName;
}
}
}
Array = null;
return OutPut;
}
private string Group(string Argument)
{
string Hyphen = "";
string OutPut = "";
Int16 d1 = Convert.ToInt16(Argument.Substring(0, 1));
Int16 d2 = Convert.ToInt16(Argument.Substring(1, 1));
Int16 d3 = Convert.ToInt16(Argument.Substring(2, 1));
if ((d1 >= 1))
{
OutPut += SNu[d1] + " hundred ";
}
if ((double.Parse(Argument.Substring(1, 2)) < 20))
{
OutPut += SNu[Convert.ToInt16(Argument.Substring(1, 2))];
}
if ((double.Parse(Argument.Substring(1, 2)) >= 20))
{
if (Convert.ToInt16(Argument.Substring(2, 1)) == 0)
{
Hyphen += " ";
}
else
{
Hyphen += " ";
}
OutPut += SNt[d2] + Hyphen + SNu[d3];
}
return OutPut;
}
private void Initialize()
{
SNu[0] = "";
SNu[1] = "One";
SNu[2] = "Two";
SNu[3] = "Three";
SNu[4] = "Four";
SNu[5] = "Five";
SNu[6] = "Six";
SNu[7] = "Seven";
SNu[8] = "Eight";
SNu[9] = "Nine";
SNu[10] = "Ten";
SNu[11] = "Eleven";
SNu[12] = "Twelve";
SNu[13] = "Thirteen";
SNu[14] = "Fourteen";
SNu[15] = "Fifteen";
SNu[16] = "Sixteen";
SNu[17] = "Seventeen";
SNu[18] = "Eighteen";
SNu[19] = "Nineteen";
SNt[2] = "Twenty";
SNt[3] = "Thirty";
SNt[4] = "Forty";
SNt[5] = "Fifty";
SNt[6] = "Sixty";
SNt[7] = "Seventy";
SNt[8] = "Eighty";
SNt[9] = "Ninety";
US[1] = "";
US[2] = "Thousand";
US[3] = "Million";
US[4] = "Billion";
US[5] = "Trillion";
US[6] = "Quadrillion";
US[7] = "Quintillion";
US[8] = "Sextillion";
US[9] = "Septillion";
US[10] = "Octillion";
}
protected void Button1_Click(object sender, EventArgs e)
{
string currency = "Rupees ";
string _currency = " Paise Only";
if (Convert.ToDouble(TextBox1.Text) == 0)
{
TextBox2.Text = "Null Value";
return;
}
if (Convert.ToDouble(TextBox1.Text) < 0)
{
TextBox2.Text = "Invalid Value";
return;
}
string[] no = TextBox1.Text.Split('.');
if ((no[0] != null) && (no[1] != "00"))
{
Number = no[0];
deciml = no[1];
_number = (NameOfNumber(Number));
_deciml = (NameOfNumber(deciml));
TextBox2.Text = currency + _number.Trim() + " and " + _deciml.Trim() + _currency;
}
if ((no[0] != null) && (no[1] == "00"))
{
Number = no[0];
_number = (NameOfNumber(Number));
TextBox2.Text = currency + _number + "Only";
}
if ((Convert.ToDouble(no[0]) == 0) && (no[1] != null))
{
deciml = no[1];
_deciml = (NameOfNumber(deciml));
TextBox2.Text = _deciml + _currency;
}
}
and error is:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
Source Error:
Line 166: }
Line 167: string[] no = TextBox1.Text.Split('.');
Line 168: if ((no[0] != null) && (no[1] != "00"))
Line 169: {
Line 170: Number = no[0];
|
|
|
|
|
Wow - what a world of ugliness. Have you stopped to read the error message, and consider what it might mean ? Have you stepped through the code ?
If you're taking a class, you need to talk to your teacher, you are lost. If you're teaching yourself, buy a book on C# and read it carefully.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
prateekfgiet wrote: System.IndexOutOfRangeException: Index was outside the bounds of the array.
Error clearly says that the value of array is going to outside the boundary. So, Put a breakpoint over there and check the array index.
|
|
|
|
|
You are trying to access an item index which does not exist in the array. As Abhijeet rightly said, putting breakpoints and debugging it can track the issue and take you to the resolution.
Regards
Saanj
Either you love IT or leave IT...
|
|
|
|
|
i have put break point, when control reach
if ((no[0] != null) && (no[1] != "00"))
it gives error
how can i remove this error pls tell me
i m totally exhaust.
pls help me
|
|
|
|