|
Yes. My problem is the same. If possible, please share the code with me. My email id is abhisek.ch84@gmail.com.
|
|
|
|
|
Hi,
I am trying this for couple of days. But could not solve it.
I am calling a stored procedure (it has 3 I/P parameters) with command object and binding to a gridview.
One parameter takes multiple values (ex: 10,20,30) When I debug the application, all the values, its passing correctly.
(When I run the stored procedure in the back end, its giving all the rows)
But after binding to gridview, its displaying only the first value.
For example,
If I pass company as 120 and fund as 10,20,30 and date as 3/31/2008, the stored procedure is taking all the values. But when it displays in the grid it showing only the data of fund 10.
Please help me. how can I get the values in the grid.
Thank for all your help.
Vasini
|
|
|
|
|
call method DabaBind of GridView
GridView1.DataBind();
I Love SQL
|
|
|
|
|
Thanks for the reply. I have binded to the gridview. Its displaying the first value. I would like to display all the 3 or 4 ( how many I pass) in the grid.
Thanks again....
|
|
|
|
|
the values 10,20,30 which u give in parameter can it be stringed? like this 10+','+','+20+','+30
then probabbly u can get result which u want in gridview.
I Love SQL
|
|
|
|
|
I you dont show your stored procedure, i dont think someone is gona be able to figure it out
Alexei Rodriguez
|
|
|
|
|
hi
i m using asp.net and vb.net.How can i implement a clock in a page???
please help
thank you
|
|
|
|
|
|
hey guys
i have a drop down list in my DetailsView control that when the DetailsView DataBinding event calls i'd like to ptogramitically select a certain item in it
i used this code but it returns an error:
(Object reference not set to an instance of an object.)
protected void DetailsViewEditLink_DataBinding1(object sender, EventArgs e)
{
DropDownList drpEditType = new DropDownList();
drpEditType = (DropDownList)DetailsViewEditLink.FindControl("drpEditType");
drpEditType.SelectedValue = [SomeValue]; //Error happens in here
}
I'd like to know why this error happens
troubling shoot tips were:
1. use the "new" keyword to create an object instance (which i did or didnt i?!)
2. check to determine the object is null before calling the method (what object is null?!)
thank you so much
|
|
|
|
|
Farhad Eft wrote: drpEditType = (DropDownList)DetailsViewEditLink.FindControl("drpEditType");
If FindControl() is not getting the control, it will return a null value.Always check for null before you do something with that object. This is the way to avoid error.
Farhad Eft wrote: use the "new" keyword to create an object instance (which i did or didnt i?!)
Here no need to use the new keyword. You are assigning the reference here.
|
|
|
|
|
oh i see
so can you please tell me how can i find a specific control like a drop down box that i put in one of edit item templates of my DetailsView template fields.
|
|
|
|
|
On the prerender method of the detailsview
Ask for the currentmode
<br />
If Me.dv.CurrentMode = FormViewMode.Edit Then<br />
CType(Me.dv.FindControl("controlid"), DropDownList).Selectedvalue = YourValue<br />
End If<br />
Alexei Rodriguez
|
|
|
|
|
How do you guys handle exceptions in ASP.NET applications? Client-side pop-up tricks? Catch and redirect to a helpful error message page, or default and redirect to a general error page? Change views from a capture view to an error view? The way I think I should be going about this is:
Client-side validation messages etc.
Server side catch specific exceptions only at top level, i.e. in Page code, and redirect to or present task specific error message.
Server side "auto" redirect for all other exceptions.
Pits fall into Chuck Norris.
|
|
|
|
|
Brady Kelly wrote: How do you guys handle exceptions in ASP.NET applications?
That's a requirements related question so the answer can be different from company to company as well as application specific. There is no cook book answer to that question.
That said, most server based processes should log things as this makes problem solving much simpler. That's not saying that desktop applications should not log.
ASP.NET has some default message options that you should understand before deciding. In our case we just use those and in conjunction with logging we have found it works just fine for us.
led mike
|
|
|
|
|
Hi
I am having problems getting set focus to work, I have a page with numerous user controls on it but always need the focus to return to one text box following postback. - This control is also within its own user control.
I have stripped out lots of code to try and track down the error, my current position is as follows.
The main page has one button on it, to force a postback, there is no code within the onclick event. The page has one user control, SwipeCard2
This user control has an update panel on with updatemode set to conditional, a text box (txtswipe) and a label lblError.
This control has the following code which is used to register the javascript to set the focus
Public Sub SetFocusToControl(ByVal page As System.Web.UI.Page, ByVal control As System.Web.UI.Control)
Dim strScript As String = String.Format("document.getElementById('{0}').focus();", control.ClientID)
strScript = String.Format("<script language=""JavaScript"">{0}</script>", strScript)
page.ClientScript.RegisterStartupScript(Me.GetType(), "setFocus", strScript)
End Sub
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
' CSBSetFocus()
SetFocusToControl(Page, Me.TxtSwipe)
Me.UpdatePanel1.Update()
End Sub
The above code works a treat, if you click anywhere on the page to remove the focus, then click on the button, the cursor is returned to the text box within the user control.
I have now added the following code to the TextChanged event
Me.lblError.Text = "This is not a supervisor account!"
Me.TxtSwipe.Text = String.Empty
Me.UpdatePanel1.Update()
Now the cursor will not appear in the textbox following postback,
Any ideas?
Regards
Tom
|
|
|
|
|
If anybody else wants to know the fix put
ScriptManager.GetCurrent(Page).SetFocus(Me.txtScan)
in pre render of the control
|
|
|
|
|
hi all
i have a problem please suggest me the solution
i have a datagrid which consists of bounded columns
i need to get the column number or column index
datagrid sample is like this
where heading channel and corporate are link buttons dynamically displayed
slno | region Name |channel | corporate|
1 | abc |ruleset | forapproval
2 | a23 |ruleset | forapproval
3 | 2asdas |ruleset | forapproval
4 | adas |ruleset | forapproval
so when i click on channel->ruleset i need to get the column no as 2..
based updon the column number i need to display the details
if 2 then channel details else corporate details
please .. its very urgent
|
|
|
|
|
Hi,
I would make the column ruleset a LinkButton.
In your aspx you create a TemplateField that has a LinkButton like:
<asp:LinkButton runat="server" ID="lbRuleSet" CommandName="EditGrid" OnCommand="Grid_OnCommand" />
In the codebehind you create a Method like:
protected void Grid_OnCommand(Object sender, CommandEventArgs e)
{
LinkButton btn = (LinkButton)sender;
GridViewRow row = (GridViewRow)btn.NamingContainer;
if (e.CommandName.Equals("EditGrid"))
{
MyGridView.SelectedIndex = row.RowIndex;
MyGridView.SelectedIndex = -1;
}
}
|
|
|
|
|
Hi guys...
OK, picture the scene if you will...a standard SP returns some codes and VAT values. The codes are in varchar(3) fields.
This data is then bound to a DataList - not directly, but with an Item template, containing a drop down list for the rates. Now when binding, the values are correctly added to the ddl, but the selected value is not being set correctly. Looking at the code, when I do the databind, the column is indeed "1" or "x" or whatever...so far so good, but in the databind event handler, when I look at e.Item.DataItem's version of the value (used to determine which item to select), it's being returned as "1 " or "x "
Anyone seen anything similar? It's almost as though the function call to the bind event is what's doing the mangling. but I can't see how!
I've also tried changing the column to a varchar (1) in the database, but bizarrely, it still appears as "1 " in the bind event. To add even more complexity(!) this is only ocurring on a client's dataset - on our "reference" dataset, with similar data, all is fine...
C# has already designed away most of the tedium of C++.
|
|
|
|
|
I vaguely recall wrestling with something like that that, and I don't believe I resolved it. I think I just worked around it.
Pits fall into Chuck Norris.
|
|
|
|
|
Hi there,
How can i check the font used in different cultures?
Suppose i'm changing the culture as "hi-IN", where i can see the font using for hi-IN?
Regards n Thks
Sam.M
|
|
|
|
|
Hi sam,
generally you can test it through various free translator, available on net...
for example use this : http://www.freetranslation.com
|
|
|
|
|
helooooooooooo Every Body
how to use smtp.gmail.com for sending mail. its free Server please help me
Thanku
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Have you tried smtp.google.com?
Regards n Thks
Sam.M
|
|
|
|
|
yaaa i use this in last night but it give athentication errro
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|