Does anyone have a tricky tip to simplify my complex String Operations? I receive a string sequenze from database which i have to manipulate on RowDataBound of an GridView, put the String into several controls. The String looks like this:Here goes a introduction string with easy formating options such as {blue}blue text{/blue}
{CONTROL}{ParamsForControl|ParamsForControl}Text for Control 1{/CONTROL}
{CONTROL}{ParamsForControl|ParamsForControl}Text for Control 2{/CONTROL}
{CONTROL}{ParamsForControl|ParamsForControl}Text for Control 3{/CONTROL}
Some Text at the end.My first try was easy because I haven't had an introducing and a ending text, so I split the String at "{CONTROL}" extract the Parameters and replaced "{/CONTROL}" with nothing, works fine...But if i now split at "{CONTROL}" how to handle the text in front of and behind them... I do a lot of string.IndexOf and String.LastIndexOf operations but I hope there is an easier way...Result should be:
Introduction Text = Label
Control = UserControl
Control = UserControl
The problem which I present involves needing a more complex string comparison mechanism with Linq to handle user driven queries of irregularly formatted data. The one instance I will use to explain this problem is phone numbers. To search a phone number you want to compare just the numbers (This system has to be able to handle internation as well as US domestic numbers). So users have been able (through many years) to enter phone numbers in any format they desire, ex:
555.555.5555 or +1 555 555 5555 or (555) 555-5555 etc
So I have a query I would LOVE to use, but because SQL cannot translate regx objects I have very few options that I am aware of. The query I want to use is as follows:...............
Have try to send the complex string that is created(serilize) from data.If I write just a regular string there is no problem but I want to sendover the array data as a string and then deserilize it does not work.What happens is that the webmethod 'save' never start. No error occurs!I suppose it is becouse the string contains a lot of " but I dont know howto change that and then bee able to deserilize it to the object.The string 'strData':
"{'JSONString': '[{"Show":false,"SortOrder":"","QuestionText":"Ingen rapport lämnas till kund då följande muntliga rapport har lämnats:","DefaultValue":"","CSS":"","Note":"","RQID":"Label","FunctionNr":0},{"Show":false,"SortOrder":"","QuestionText":"Lämnar
I have a page which is accessible only from Monday to Friday. If i try to open it on Saturday or Sunday it shouldn't.I have a column in my DB naming WorkingDays and iam storing Bitwise value
Monday=1,Tuesday=2,Wednesday=4,Thursday=8....
So the value in my DB is 31 which is equal to Monday to Friday.If i open the page on saturday how should i check?
How should i convert todays day to bitwise value and how should i compare with the DB value.
I want to ask that what happens when I make a database request (using Linq-To-Sql). Active thread is blocked and waits for response, or it is used to process other requests?
Do frameworks like Linq-To-Sql or Linq-To-Entities handle this?
If I use Sleep() method on thread, is that thread blocked or is it used to process other requests?
when i log out, i have this problemwhen i enter the authorized section, its still keep showing me the page, only when i refresh it,it brings me back to login page.for example,i logged in as manager,and then i logged out.when i enter the same authorized managment page it keeps showing me content, but when i refresh it brings me back to the default login page.
I'm developing an asp.net web applcition that works with sql server. i'm using Entity model as DAL.I user repository pattern for my business layer, now, i'm going to design UI.this is my business layer code:
[Code]....
I have some questions: becase all of entites need to have CRUD operations, so i want to have a master page with Insert, Edit, Deleter Button and a place holder for entity form, so for each entity i create a form with this master and create textboxes and label in asp:content tag.for this to be done i konw master must have a Interface to do operations. so i wanted to define ISchoolSystemRepository<??> as a property in master page, but i must pass it T which will determined in runtime. so
I'am refactoring a website administration control panel code, wich is made afcourse in ASp .NET WebForms with C#.
Now I have implemented View, Edit, Delete, New operations on every managerPage.
For example if I have userManager page first I see List with option Show (view).
On details page a have Edit, Delete options on the bottom of page.
Now I want to implement some kind of generic OPERATIONS BAR like this: But I need a way to implement that efficiently. I want to implement it like encapsulated userControl.
I thinking something like IBaseView interface wich is implemented with specifically page (view).
i am displaying a gridview from db(SQL2005), which display leave table where employee apply leave and submit to admin. Viewing the leave table in gridview the admin sanction or rejected their leave request, by clicking the check box displays on each gridview rows and click on sanction or rejected button.
here i am sending SMS to the employee number displaying in the gridview (taking the employee phone number and send SMS).. this i have done using bulk SMS services, i have taken the number using the following if check conditions...
but now what the problem is i have to delete the gridview rows.. i am using the same employee phonenumber to delete the corresponding gridview, but if suppose the single employee applied for two or more leave, the gridview display all leave for the single employee, the admin have sanction only one leave for that employee.. so if he checks the check box and click on OK button.. it have to delete the corresponding row as well as send SMS to the phonenumber of the employee.. Other leaves of the same employee display in the gridview.. i used the following coding
Protected Sub bttnsanction_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bttnsanction.Click Dim row As GridViewRow Dim selection As New ArrayList() For i As Integer = 0 To GridView1.Rows.Count - 1.........
I am using the Sno as primary key in leave table.. where i want to delete the corresponding row which sends SMS to employee number also the delete the row of corresponding Sno.. i have to get the corresponding gridview row sno in the delete store procedure..
I have placed Chekc box in Gridview when i select the check box can perform 2 operations simultaniously one is entire recordset is populated into form fileds and second one is can delete the selected record permanently from database table.following code for this fuctionality.
I need to convert the word doc to pdf, ofcourse i did it,But i converted only simple word file that has only strings. But I need to convert the word doc that has images tables with all formatings how Can i achive it.
I want to use my functions in DAL asynchronously by executing them in a separate thread. The issue in all this is suppose I have a function DAL.GetProducts() which returns a DataTable. If I execute this function in a separate thread, when it is completed how do I get the returned DataTable from this thread and bind it to my UI?
i want to get the parameters in my page load event (language as C#). i dont know how the get the values for "Label", "ID", "Value" and "Mask" from the query string. all the data need to be put on the array like LabelArr, IDArr, ValueArr and MaskArr.
I have a table in a DB in which I need to perform the following operations:
1. Order the table using index A. 2. Traverse the table and do some calculations for every row. 3. Order the table using index B. 4. Traverse the table and do some calculations for every row. 5. Order the table using index C. 6. Traverse the table and do some calculations for every row.
As you can see, what I need is to process such a table several times depending upon a different index for every process. If I use a DataReader I can only traverse it one way and one time, I cannot apply another index and start from the beginning once again. What strategy should I use to achieve my goal? Is a DataTable a good choice?
I'm reading the stream from a FileUpload control, reading in chunks of n bytes and writing the array in a loop until I reach the stream's end.Now the reason I do this is because I need to check several things while the upload is still going on (rather than doing a Save(); which does the whole thing in one go). Here's the problem: when doing this from the local machine, I can see the file just fine as it's uploading and its size increases (had to add a Sleep(); clause in the loop to actually get to see the file being written).
However, when I upload the file from a remote machine, I don't get to see it until the the file has completed uploading. Also, I've added another call to write the progress to a text file as the progress is going on, and I get the same thing. Local: the file updates as the upload goes on, remote: the token file only appears after the upload's done (which is somewhat useless since I need it while the upload's still happening).
Is there some sort of security setting in (or ASP.net) that maybe saves files in a temporary location for remote machines as opposed to the local machine and then moves them to the specified destination? I would liken this with ASP.net displaying error messages when browsing from the local machine (even on the public hostname) as opposed to the generic compilation error page/generic exception page that is shown when browsing from a remote machine (and customErrors are not off)
I'm trying to set the default button to my master page for logging in.
Basically I've got a master page, with a LoginView in it, with a Login control in it, With a button in it... When you press "Enter" I want it to use that as the default button.
(structure in sudo-code if it helps)
BODY Form ID=Form1 LoginView ID=MasterLoginView AnonymousTemplate Login ID=MainLogin LayoutTemplate Button ID=LoginButton
I know I've got to use .FindControl("") but as much as I mess with it I can't seem to get it to hook to the button.
I recently purchased a new domain for the sole purpose of hosting all the static content on a separate server and delegate CPU intensive operation like thumbnail creation on a different pool. Now I would like to do some operations on images uploaded to that remote server : creating thumbnails or updating the image if we need to. Should I download the images to my server, modify them there and then upload them back to the remote server or should I try to create web-services to manipulate the images?One of my solution was to provide an interface to upload and manipulate the images in the new domain, by leaving the old domain when it comes time to work on images, but I find it kind of awkward.I would like to keep the new domain cookie free. How would that affect my ability to restrict any random user to use the web-services if I decide to go that way?
I find myself needing to preform the same actions on both HtmlControls and WebControls. I am a firm believer in DRY and find the fact that there is only the Control class to use if I want to consolidate the functions on both types. The problem that I have with using Control is that there certain properties that both HtmlControl and WebControl expose that Control does not. In the current case, the Attributes property is the problem. how to avoid the duplication of code in this type of instance?
I have one asp.net application, in which i am using "Calling WCF Service Operations in AJAX" method. I finished my work without the service hosting in IIS. I got the correct solution. But now, i have another requirement in which i am using the WCF service which is hosted on local host iis. But in clicking the button i got one javascript error like object expected. I don't know why this happened? My code is shown below.
<fieldset style="width: 804px" align="center"> <legend>Consuming WCF Service using Client-Side AJAX</legend> <div align="left" style="text-align: center"> <form id="form1" runat="server">
I want to build a reusable control which will enable e to perform add/edit/delete operations easily. All I want to do is give the control a datasource and it will handle the rest.
What controls should I use? I want it to be as user friendly as possible.
How do I ensure and enforce that all write operations to my MS SQL Server DB are transactions-based?
The reason I want to do this is that the DB contains financial account data and operations that fail halfway through some set of changes should not be able to mess up the database by mistake or by crashing.
The application is written in ASP.NET C#.
Edit:
There is a DAL but it does not (yet) require transactions for changes.We wrote the DAL ourselves. We did not use ORM.
I know how to perform one transaction from ASP.NET.
I want to ensure that all changes are made in transaction form so that if the application throws some exception in the middle, there will be no change to the database.