.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Is there WPF text object that use/return stringBuilder?

Posted By:      Posted Date: October 03, 2010    Points: 0   Category :WPF

TextBox/TextBlock .Text returns string

if i wanna manipulate a large bunch of string, stringBuilder should be the thing to be used, but is there an ui control use/return this object as well?

View Complete Post

More Related Resource Links

Posting data to ASMX and return Object for jQuery


I am using fluent NHibernate with WebForms and I am trying to build a page where I allow a user to post a status update on their profile page and I a using a .asmx WebService to post the data to the database and then returnig a StatusUpdate instance to the page to be used by jQuery. I have a couple problems.

1) First off when I return a string from the WebService(i was testing) the textbox where the user enters their status doesnt empty the contents. And since the page doesnt refresh even if I manally clear out the textbox and put in something else, it still posts the previous status to the database again. How do I fix this?

2) Secondly, when I return the StatusUpdate Object from the Webservice I cant the results to display anything. Like I sad, Im using jQuery to make an AJX call to the WebService.

Here is my code:

User Profile Page:

Status: <asp:Label ID="status" runat="server"></asp:Label><span style="font-size:.7em;"><asp:Label ID="statustime" runat="server"></asp:Label></span><br />
<textarea id="statusBox" rows="3" cols="40"></textarea><br />
<input type="button" value="Update Status" onclick="SetStatus(); return false;

row.Cells[4].Text return nothing in GridView ?

I have a GridView in my page : <asp:GridView ID="GridView1" runat="server" AllowPaging="True" BackColor="White" AutoGenerateColumns="False" EmptyDataText="No data available." BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" Width="729px" ForeColor="Black" GridLines="Vertical" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"> <RowStyle BackColor="#F7F7DE" /> <Columns> <asp:TemplateField HeaderText="TransactionKey" SortExpression="TransactionKey"> <EditItemTemplate> <asp:TextBox ID="TextBoxGridViewTransactionKey" runat="server" Text='<%# Bind("TextBoxTransactionKey") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="LabelGridViewTransactionKey" runat="server" Text='<%# Bind("TextBoxTransactionKey") %>'></asp:Label> </ItemTemplate> <HeaderStyle Font-Size="14px" /> <ItemStyle Font-Size="12px" /> </asp:TemplateField> <asp:TemplateField He

How to control the text and other properties in ResourceDictionary object that i wrote ?

I wrote some ResourceDictionary. This ResourceDictionary is actuly a button that i use - I created this button by using Rectangle and TextBlock ==> that mean that the my xaml look like the code below. The problem is that i cant change the font size and the text of the TextBlock. I can change is just from the xaml of the template. And ... How can i define some variable that will control on the rectAngle redius in runtime ? Someone can help ?? ? Thanks. ...<ResourceDictionary> <Style x:Key="MyBtn" TargetType="{x:Type Button}"> <Rectangle ... <TextBlock.... </ResourceDictionary> ...

Using a Variable in SSIS - Error - "Command text was not set for the command object.".

Hi All, i am using a OLE DB Source in my dataflow component and want to select rows from the source based on the Name I enter during execution time. I have created two variables, enterName - String packageLevel (will store the name I enter) myVar - String packageLevel. (to store the query) I am assigning this query to the myVar variable, "Select * from db.Users where (UsrName =  " + @[User::enterName] + " )" Now in the OLE Db source, I have selected as Sql Command from Variable, and I am getting the variable, enterName,. I select that and when I click on OK am getting this error.   Error at Data Flow Task [OLE DB Source [1]]: An OLE DB error has occurred. Error code: 0x80040E0C.An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80040E0C  Description: "Command text was not set for the command object.". Can Someone guide me whr am going wrong? myVar variable, i have set the ExecuteAsExpression  Property to true too. Please let me know where am going wrong? Thanks in advance.

putting carriage return/line feed in non-HTML email text

Using vb.net/asp.net 2005I am trying to create a string message for an email that I am sending out from my asp.net page like so: For Each dr In dtDataTable.Rows strMessage = strMessage & vbCrLf & vbCrLf & Environment.NewLine & dr.Item("UserName") & Environment.NewLine Next so I am looping through a datatable and getting each name from each row, that is working well but when I get the email it appears in my inbox with all the names mashed together, you see I am trying both vbcrlf and newline but looks like neither is workingdoes anyone know what I'm doing wrong?

Full Text Search Return no Result while "Like" does

Someone pls look at the picture and help me I tried Restart the serviceI tried restart the server But the number of row affected is still zero :(

How to use return JSON object from web service as a declared Type?

Hi, I just hit the following issue: I am calling a web service that returns a serialized JSON object let's say: __type, FirstName, LastName (.net object Person with properties FirstName and LastName). __type's value is Test.Person I have created a JS object using Type.registerNameSpace/registerClass called Demo.Person and it is registered on the page using the ScriptManager. Everything is working fine; I am able to get data from the server on the call back. Is it possible to make the returned object from the web service be an instance of the declared JavaScript Demo.Person class? The idea would be to call a method like result.getFullName() on the client side without having to copy all the properties. This is just a simple scenario for more complex objects.   Thanks,   Teo

how to query return all data in Array Object ,Collection Object

how to query return all data in Array Object ,Hash Table ,And DataTable dataRowSelect * From Doc a

Capture large text return from Javascript function


I have a Javascript function that writes a large scale of text into a div for now, but then I need to capture the text and use it in code behind. I tried to use hidden field but it has size limit so it didn't work.  The text is shown in the page, but when I view source, there is no text in the div so I couldn't use code behind to read the text from the div even though runat is server because the text is always empty. Any suggestions? Thanks!!!

OCIEnvCreate failed with return code -1 but error message text was not available.



We have a requirement to connect to oracle from ASP.NET and we installed ODAC(ODAC1110621) components  on the server but still we are getting the following error while opening the connection. Please find the details below:-

OCIEnvCreate failed with return code -1 but error message text was not available.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: OCIEnvCreate failed with return code -1 but error message text was not available.

Source Error:

Line 16:     {
Line 17:         OracleConnection con = new OracleConnection(ConfigurationManager.ConnectionStrings["HRDBA"].ConnectionString);
Line 18:         con.Open();
Line 19:         Label1.Text = con.State.ToString();
Line 20:         con.Close();

Source File: \\hs003fs01-02.homebase.com\wfmp\Webpage1.aspx.cs    Line: 18

Stack Trace:

Can we bind a StringBuilder to Textblock Text ?

<TextBlock Text="{Binding Path=Pval, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

public StringBuilder Pval { get; set; }

StringBuilder Pval= new StringBuilder(1000);

Error: Office 2003 SP3 "Command text was not set for the command object"




I have a customer who is using Office 2003 pivot tables against AS2000 cubes. Last week they upgraded to SP3 of Office and now we are getting "Command text was not set for the command object" when trying to refresh / manipulate the pivot tables. Applies to existing pivot tables as well as new ones we create. I found a few references to interesting experiences with SP3, but none that mention this error. We know the cubes are OK because we can use pivot tables against them from another (server) machine that escaped the upgrade. Currently trying to prove or disprove that it was the upgrade specifically that caused the problem.


Has anyone else bumped into something like this? Found a way around it?


Thanks in advance

Serialization using SQL server or storing a table object as text in a text column



I have a requirement in SQL server 2008 as follows:

I need to Insert into a particular table say Output at runtime where one of the columns (Content) of type text should contain an object of another table (Audit). This is currently being done through C# by serializing the Audit table and updating the Content with the serialized value. But this needs to be done in SQL now as per the requirement.

Can this be done by creating an object of Audit and storing in Output.Content in SQL itself?

Thanks in advance for the help.





How to return serialized JSON object from WCF



I am able to return the JSON string from the wcf. But i want to return the JSON object from wcf.

Is is possible to return the JSON object from the wcf? If yes , then how?


Thanks in advance..... 

TextBlock Text not refreshed after raising PropertyChanged - object instance the same, ToString() re



I am working with an object that handles localized strings.  The object type (LocalizedString) provides the correct localized string in its ToString() method.

I have a view model that exposes a property of type LocalizedString.  When my current thread and ui culture is changed, I raise the property changed event for this property, however the strings in the UI do not get updated.

I narrowed it down some to discover that it stops working after the value has been read from the property once.  If instead of just raising property changed when the culture changes I do this:


LocalizedString temp = MyProperty;
MyProperty = null;
MyProperty = temp; // <-- property changed gets raised in the setter 


It seems to work.  The only difference is that the LocalizedString object instance changed.

Basically I believe what happens is this:  The dependency property (TextBlock.Text in this case) gets notified that the bound value has changed.  It goes and retrieves the property value (LocalizedString object), does a comparison and sees that the previous value and the new value are the same object instance, and stops - does not refresh the

Thinking about new C# method prototypes: object as dictionary

I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.

C# Object Oriented Programming

So far in C# Essentials we have looked at the basics of programming in C# such as variable types and flow control. Although it would be possible to write a functional program using these techniques, there is much more to becoming a proficient C# programmer. C# is, above all, an object oriented programming language and as such any C# programmer will be expected to create object-oriented applications using this language.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend