|
Hello all,
I am having a issue that for the life of me is driving me nuts!, hopefully someone here can shed some light as to what i am doing wrong?
Code Follows(C#)
try
{
SqlDataReader myDR = DataConnElement.ReturnDataReaderSP("upGetAllMachineNames");
MachineNameList.DataSource = myDR;
MachineNameList.DataValueField = "MachineName_ID";
MachineNameList.DataTextField = "MachineName_Title";
MachineNameList.DataBind();
}
catch (Exception ex) //just used for debugging (not able to write to error file atm)
{
Response.Write(ex.StackTrace.ToString());
Response.Write(ex.Message.ToString());
}
//The Procedure that is called (ReturnDataReaderSP)
public SqlDataReader ReturnDataReaderSP(string StoredProcedureTitle)
{
try
{
using (sqlconn)
{
sqlconn = new SqlConnection(ConnString);
SqlCommand sqlcomm = new SqlCommand(StoredProcedureTitle, sqlconn);
using (sqlcomm)
{
sqlcomm.CommandType = CommandType.StoredProcedure;
sqlconn.Open();
SqlDR = sqlcomm.ExecuteReader(CommandBehavior.CloseConnection);
return SqlDR;
}
}
}
finally
{
sqlconn.Close();
}
}
|
|
|
|
|
Datareader is only valid as long as the connection is open. It is a fast-forward read-only cursor in the DB. You need to read the data into a collection, then close the connection and pass the newly created connection to the datasource. One common method:
using(SqlDataReader reader = command.ExecuteReader()){
while(reader.Read()){
Customer customer = new Customer();
customer.Populate(reader);
listOfCustomers.Add(customer);
}
}
connection.Close();
return listOfCustomers;
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
Hello,
I'm using a radiobuttonlist with 5 listitem, depending on the user choice a different view will be diplayed. All this is placed in an updatePanel control to avoid refreshing the whole page on each Radio button change click. Everything works fine except when initially a radiobuttonlist item is by default selected in my aspx code. What happens is all other radiobuttons click refresh the view except when i click back on the previous default selected radiobutton. Any ideas how I can resolve this in a neat way? I obsolutley have to have the first RadioButton selected by default cause it's a none view selection.
Please find below part of the code I'm using.
<pre><asp:RadioButtonList ID="ExpressionSystemRB" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ExpressionSystemRB_SelectedIndexChanged" RepeatDirection="Horizontal">
<asp:ListItem Text="None" Value="none" Selected="True"></asp:ListItem>
<asp:ListItem Text="Hybridoma" Value="hybridoma"></asp:ListItem>
<asp:ListItem Text="Stable cell line" Value="cellLine"></asp:ListItem>
<asp:ListItem Text="Transient expression" Value="transient"></asp:ListItem>
<asp:ListItem Text="Recombiniant stain" Value="recombiniant"></asp:ListItem>
</asp:RadioButtonList>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ExpressionSystemRB" EventName="SelectedIndexChanged" />
</Triggers>
<ContentTemplate>
<asp:MultiView ID="ProductionInfoMultiView" runat="server" ActiveViewIndex="0">
<asp:View ID="noneView" runat="server" >
// empty view
</asp:View>
<asp:View ID="hybridomaView" runat="server" >
// view 1 table display
</asp:View>
<asp:View ID="cellineView" runat="server">
// view 2 new table display
</asp:View>
<asp:View ID="transientView" runat="server">
// view 3 new table display
</asp:View>
<asp:View ID="recombiniantView" runat="server">
// view 4 new table display
</asp:View>
</asp:MultiView>
</ContentTemplate>
</asp:UpdatePanel></pre>
***************************
so if I put a selectedvalue=true like this
<code><asp:ListItem Text="None" Value="none" Selected="True"></asp:ListItem></code>
whenever i click on the none RB the view won't refresh but if i take the selected = true out everything works fine!!!
her'es the codebehind of the method i call on each RB click
<pre>protected void ExpressionSystemRB_SelectedIndexChanged(object sender, EventArgs e)
{
if (ExpressionSystemRB.SelectedValue == "none")
{
ProductionInfoMultiView.SetActiveView(noneView);
}
else if (ExpressionSystemRB.SelectedValue == "hybridoma")
{
ProductionInfoMultiView.SetActiveView(hybridomaView);
}
else if (ExpressionSystemRB.SelectedValue == "cellLine")
{
ProductionInfoMultiView.SetActiveView(cellineView);
}
else if (ExpressionSystemRB.SelectedValue == "transient")
{
ProductionInfoMultiView.SetActiveView(transientView);
}
else if (ExpressionSystemRB.SelectedValue == "recombiniant")
{
ProductionInfoMultiView.SetActiveView(recombiniantView);
}
}</pre>
Thanx in advance for your help!
|
|
|
|
|
Don't set the value with codebehind. maybe you can set the default with javascript using page.registerstartupscriptblock. Then it will post back.
I didn't get any requirements for the signature
|
|
|
|
|
Thank you for your answer but in the main time I found a way to do so without using javascript!
So basically as my RadioButton has to be refreshed too, I saw on a site that it's better to put my RadioButton inside the UpdatePanel and the <contentTemplate>. So here's how my code is now and it works perfectly!
<pre><asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:RadioButtonList ID="ExpressionSystemRB" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ExpressionSystemRB_SelectedIndexChanged" RepeatDirection="Horizontal">
<asp:ListItem Text="None" Value="none" Selected="True"></asp:ListItem>
<asp:ListItem Text="Hybridoma" Value="hybridoma"></asp:ListItem>
<asp:ListItem Text="Stable cell line" Value="cellLine"></asp:ListItem>
<asp:ListItem Text="Transient expression" Value="transient"></asp:ListItem>
<asp:ListItem Text="Recombiniant stain" Value="recombiniant"></asp:ListItem>
</asp:RadioButtonList>
<asp:MultiView ID="ProductionInfoMultiView" runat="server" ActiveViewIndex="0">
<asp:View ID="noneView" runat="server" >
// empty view
</asp:View>
<asp:View ID="hybridomaView" runat="server" >
// view 1 table display
</asp:View>
<asp:View ID="cellineView" runat="server">
// view 2 new table display
</asp:View>
<asp:View ID="transientView" runat="server">
// view 3 new table display
</asp:View>
<asp:View ID="recombiniantView" runat="server">
// view 4 new table display
</asp:View>
</asp:MultiView>
</ContentTemplate>
</asp:UpdatePanel></pre>
|
|
|
|
|
Well, I am glad you got it to work. Since I use Telerik's AJAX control's I'm not as familiar with the standard aspnet ajax.
I didn't get any requirements for the signature
|
|
|
|
|
Convert rdlc to PDF without using LocalReport.Render method
Thanks inadvance
|
|
|
|
|
LocalReport.Render method is working for less number of pages.
but when we try for more number of pages (say 20,000) we are getting "Server Application UnAvailable"
Any Alternate method for this?
Please help us , this is very urgent.
Thanks inadvance.
|
|
|
|
|
Member 1837661 wrote: Please help us , this is very urgent.
No, it's not. Not to us, anyhow.
What on earth are you talking about ? Why did you post twice ? If you're generating a PDF, what library are you using ? Does Crystal do that, or is it third party ? Your questions are very unclear.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi guys
I am making a string builder and this string i have to sent on Email
local its working fine while uploading its giving error "A page can have only one server-side Form tag. "
while in my application i am rendering a panel (panel id =panel1)
after that i am using tag
vb.net code
Dim sbr As New StringBuilder
sbr.Append("<html>")
Dim swr As New StringWriter(sbr)
Dim htw As New HtmlTextWriter(swr)
panel1.RenderControl(htw)
sbr.Append("<p> </p>")
sbr.Append("<p>Warm Regards..</p>")
sbr.Append("</html>")
and html code
<asp:panel id="panel1" runat="server" width="90%" xmlns:asp="#unknown">
krishna veer singh
|
|
|
|
|
You must've used form tag in the same page more than one time.More than is not allowed on Page.
Why you are using form tag in the panel?
Cheers!!
Brij
|
|
|
|
|
i use this cod in a (button_Click)
in the updatepanel not work
MyMessages msg = new MyMessages();
string str = "javascript:alert(\'" + msg.GetDenied() + " " + err.Text + " " + "!\')";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Str", str, true);
ahmed eldeghedy
modified on Tuesday, November 18, 2008 6:59 AM
|
|
|
|
|
StringBuilder sbScript = new StringBuilder();
sbScript.Append("<script language="\"JavaScript\"" type="\"text/javascript\"">");
sbScript.Append("alert('Your message')");
sbScript.Append("</script>");
Literal ltMessage = new Literal();
ltMessage.Text = sbScript.ToString();
updatePabel.Controls.Add(ltMessage);
|
|
|
|
|
Hi All,
I am working on Internationalization of an existing project on ASP.net 2.0.
Are there any tools available that can help in identifying problems and issues specific to I18N.
I have looked into Fxcop but that does not handle aspx and js files.
Plz reply ASAP
Thanks,
Bijgupt
|
|
|
|
|
i want to change css of my page using javascript
how can i do that
|
|
|
|
|
Don't cross-post - it's considered rude. And anyway, this question has nothing to do with ASP.NET.
|
|
|
|
|
|
Hello,
Iam working with the asp.net FileUpload-Control (Microsoft, VisualStudio). This control contains a textbox and a button. I need to rename this button, because it's a german control with the Text 'Durchsuchen' - I need to change the text of the Button to 'search'.
Can anyone tell me, how to do this. Cant find a way to change this button-text.
Thanks for helping
(sorry, about my bad english)
|
|
|
|
|
You write better English than 95% of those here (including native speakers), and apologise for it!
I don't know of there is a simple solution to your problem. Perhaps your best bet is to download and use a third-party tool instead. This one[^] is free and, if it's like any of the others I've used from that site, good.
|
|
|
|
|
Thank you. I've got a solution for this problem, the button changes automically his language, if you use an english version of the os/browser.
I've tried to change the language of my browser and the language of the os manually, but nothing happens. If you call the website from an english version of the browser/OS, the button caption show 'browse'
|
|
|
|
|
Hi All,
I developed a project in ASP.net 3.5 and trying to upload in a web.
First I compiled that project using cmd prompt then only I upload it.In local it rums properly.But when i upload it givies error in web.config.
I used only default web.config file. Give any solution for this....
Thanks in advance
|
|
|
|
|
You haven't given enough information about your problem. It is hard to answer without knowing the error message.
|
|
|
|
|
Hi
i got the error like this...
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 51: ASP.NET to identify an incoming user.
Line 52: -->
Line 53: <authentication mode="None" />
Line 54: <!--
Line 55: The <customErrors> section enables configuration -->
Source File: f:\..\....\....\web.config Line: 53
modified on Tuesday, November 18, 2008 3:53 AM
<div class="ForumMod">modified on Tuesday, November 18, 2008 3:54 AM</div>
|
|
|
|
|
Please Show us your Error.I usually develop my App and after testing. i create a Virtual Directory in a IIS, and make sure that the Correct framework is installed for my App. and after that it will work. ok, if you have VS i dont see why using Prompt to compile, But still its your choice.
scothykonma wrote:
But when i upload it givies error in web.config.
I used only default web.config file. Give any solution for this....
Well show us your Config File Error
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I got the error like this,
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 51: ASP.NET to identify an incoming user.
Line 52: -->
Line 53: <authentication mode="None" />
Line 54: <!--
Line 55: The <customErrors> section enables configuration -->
|
|
|
|