I need to convert a SharePoint List to ASP.NET, including its column filters etc.
Aside from the underlying data which will be housed in a SQL Server table, what are good control choices on ASP.NET side for this? (I'm not sure if ASP.NET Gridview will have all the necessary features.)
I am converting my datatable to LISt using LINQ how do I handle nulls coming from database
List<Port> portDetails = new List<Port>(); DataTable dt = ds.Tables[0]; portDetails = (from q in dt.AsEnumerable() select new Port { PortCode = q.Field<string>("Code"), ExtCode = q.Field<string>("Nb"), Name = q.Field<string>("Name")) }).ToList();
In the above query if Code is null I do not want property portcode to be set to the value it should only set if it is not null or not blank PortCode = q.Field<string>("Code"),
What should be syntax I was trying somethign like this which doesnt work Portcode = q.Field<bool>("Code") == null ? null : q.Field<bool>("Code")
To convert the above data into unordered list based on depth, I'm using the following code
[code]...
But the resulting unordered list doesnt seem to be forming properly(using which i am constructing a tree).For example "Site " with id '180' is supposed to appear as a direct child of "Televisions" with id '1',is appearing as a direct child of 'Flash' with id '191' using my code.so in addition to considering depth,I've decided to consider itemid as well in order to get the treeview properly.Those rows of the table with itemId not equal to null are not supposed to have a child node(i.e.,they are the leaf nodes in the tree) and all the other nodes can have child nodes.
Update:
The 'itemid' column refers to the id of an item which is present in another table.This column just in identifying if an item has any sub items(i.e., 'name' in my data in this case has any other unordered lists under it).
is there any software I can use that allows me to programmatacilly convert a PSD into a PNG in my asp.NET web application? Where transparenct and quality are preserved.
i'm having a hard time figuring the way on converting my string into an integer number.In my form I have a textbox control from which I get the selected date as string, using the substring method I divide it to month, day and year.The problem is that I cannot, for example, convert the following "12" into the actual integer number twelve. I tried using Int32.Parse or Convert.ToInt32 but still couldn't solve it.Here's my code behind for better comprehension (this doesn't do the trick):
I am converting a webforms app to mvc. I implemented localization in webforms this way: The user selects the language, which BTW can be an rtl language, and the selection goes into the user profile in order for it to persist the next time the user visits the site. I used anonymous profiles. also, I used resource files.The db tables have multiple rows for each language (with a language index field). I also used different style sheets for ltr and rtl languages since I don't use tables on my site (Is there another way instead of using separate style sheets?) What are the best practices for using localization in asp.net mvc ? can I and should I use resource files ? and profiles ? should I map the aspnet tables to linq-to-sql ?
we are in the process of upgrading our crappy cms system and the new assemblies have changed from int to int64. I'm running into a problem when trying to build now. here is one excerpt of code that is causing a problem.
IDictionary<int, string> aliases = new UrlAliasApi().GetUrlAliasesByType( Company.DataLayer.Enumeration.UrlAliasType.Recipe); foreach (ContentBase recipe in mergedResultset) { // if alias exists, overwrite quicklink! string alias; if (aliases.TryGetValue(recipe.Id, out alias)) { recipe.QuickLink = alias; } }
The error is
Error 323 The best overloaded method match for 'System.Collections.Generic.IDictionary.TryGetValue(int, out string)' has some invalid arguments Its referring to recipe.Id which is an Int64 value.
I have written a desktop application in vb.net. Now I need to convert it into a web application in asp.net. Can you please suggest how I might proceed?
I am trying to convert some code I wrote from VB to C# and it regards Date, Times, and TimeSpans
[Code]....
the First Issue I have is with formats, I have a countdown that displays days left to enter the drawing, I just want a + int displayed no decimals, right now it shows 343.91736271538735 days left to enter drawing.
On The Page it displays Something Like this:
Drawing Date: Sunday, January 1, 2010
Days Left to Enter: 343 Days left to Enter
Right Now it Displays
Days Left To Enter :343.062117332176 Days Left to Enter
im trying to convert this into a repeater but finding it a little difficult trying to figure out how to seperate it and make it work. Basically the original code is HTML, and I want to use that but since my menu system is coming from a DB, I want to be able to bind that menu system and have it automatically just bind the menus with the x level deep nav bars etc... which this HTML code does:
[URL]
(download the zip file)
Sure, 1 repeater on the page but because this is generic, I know I dynamically have to create and add a repeater and bind the submenu items (and their children if any) to this repeater...and adding this repeater to the current item.
I have a text box; txtPriceQuoted, and want to submit it's value to my SQL Server Database, I get an error about the conversion:
"Conversion failed when converting the varchar value '12.5' to data type int."The error only occurs when there is a decimal point in the number, how should i convert it so that I can input the value into my database....?
the above code only converts controls in dvtext (div) like label name and textboxname to pdf. after entering values into textboxes. it is not convert them to pdf. it only converts control names.
It replaces leading and trailing spaces inside a specific attribute's value, globally (as per this example page: [URL]). I need to do the same on a string in C#, but when trying the above, the syntax checker chokes at the regExp. So I need the equivalent line of the above in C#.
there is eny way to convert a string type to uniqueidentifier type .... when i insert or update data , i can give string as a parameter or i must to convert to uniqueidentifier type.?
In ASP.net using VB, how can I Convert a number e.g 4.5 to french (4,5). And a quick question, when storing this in database, will It store as 4.5 or 45?
I have this code in c# and I want to convert this to T-SQL and put in stored proc. I'm having a problem in speed as I am processing more than 50000 records at a time and the Update statement slows it down. I was thinking stored procedure could help on my problem. here's what I have:
sqlStmt = "SELECT DISTINCT(phone_no) FROM TEMPTABLE WHERE sUSER='" + USERName + "' ORDER BY phone_no";