|
Yeah, I think I'm going with it. I was looking at the Infragistics grid, but it's a bit heavyweight and twice the price. I just wonder how these people can make such awkward designers. People that complain about Microsoft's designers in Visual Studio don't seem to use many other designers.
|
|
|
|
|
I believe using Telerik control will be a better idea as Telerik controls have more features. Based on the documentation and their examples, learning Telerik controls give you much better presentation as well.
Bhaskara
|
|
|
|
|
If you are developing against MS-SQL server, why not consider SQL Server Reporting ? No extra charge if you alreay have MS-SQL server. My 2 cents.
|
|
|
|
|
I need to be able to switch the application between MySQL and MS SQL.
|
|
|
|
|
I'm trying to execute a simple command and pass it to a text box, however it does not seem to work.
Any idea why?
try
{
conAppDB.Open();
string getTaskRef = @"SELECT MAX([taskID_PK]) FROM [teamwiki].[dbo].[task];";
SqlCommand getTaskRefSQL = new SqlCommand(getTaskRef, conAppDB);
if (getTaskRefSQL != null)
{
txtTaskRef.Text = (string)getTaskRefSQL.ExecuteScalar();
}
}
catch (InvalidCastException)
{
}
catch (Exception ex)
{
throw ex;
}
finally {
conAppDB.Close();
}
Environment
.NET framework 2.0.50727 SP1
Visual Studio 2005 Team Edition
Jon
|
|
|
|
|
Have you tried running your sql directly? It may not be returning any data.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Troubleshooting.
I tried using the following line and it returned the expected value on the screen, hence the SQL is working.
Response.Write(getTaskRefSQL.ExecuteScalar());
Jon
|
|
|
|
|
The result of ExecuteScalar can be one of three things.
1. An object of the type you expect. String in this case
2. a DBNull which means that the value of the column you've selected is null
3. a null which means that the query returned no data. (please check for this rather than use an invalid cast exception)
Now, on to what you asked about:
jon_80 wrote: Although the code passes through here, the value of getTaskRefSQL is null, is this a bug?
Are you sue that getTaskRefSQL is null. Unless you've missed something out of your code in the sample above there is no way getTaskRefSQL can be null at the point in the code you've said it is.
|
|
|
|
|
Colin Angus Mackay wrote: jon_80 wrote:
Although the code passes through here, the value of getTaskRefSQL is null, is this a bug?
Are you sue that getTaskRefSQL is null. Unless you've missed something out of your code in the sample above there is no way getTaskRefSQL can be null at the point in the code you've said it is.
That's what I thought; I checked again and now it has a value, however before it was reading null in the watch window
Colin Angus Mackay wrote: The result of ExecuteScalar can be one of three things.
1. An object of the type you expect. String in this case
2. a DBNull which means that the value of the column you've selected is null
3. a null which means that the query returned no data. (please check for this rather than use an invalid cast exception)
Explicit conversion was required because implicit conversion is not allowed by the compiler. I think can check for a DBNull using typeof presumably, however, since a value is being returned I'm not sure why the conversion is not working.
Related links:
http://msdn.microsoft.com/en-us/library/58918ffs(VS.71).aspx[^]
Jon
|
|
|
|
|
jon_80 wrote: Explicit conversion was required because implicit conversion is not allowed by the compiler.
I wasn't talking about that.
jon_80 wrote: I think can check for a DBNull using typeof presumably
Try something like:
object rawValue = theSqlCommand.ExecuteScalar();
if (rawValue == DBNull.Value)
{
}
else
{
string actualValue = (string)rawValue;
}
|
|
|
|
|
|
|
You're right I still haven't planned any error handling as yet
Jon
|
|
|
|
|
Hello All,
I want to delete value from cookie
For Example: The Cookie name [myCooke]
The Cookie Contains--------------------------------------------------------------------------------
myCookeLotID1=7amp;LotNo1=003462&LotName1=Lot 7&BuyPrice1=850&StockQuantity1=56
amp;amp;LotID2=5&LotNo2=003859&LotName2=Lot 3&BuyPrice2=154&StockQuantity2=2
localhost/1536149997862429993731246977484829981862*
---------------------------------------------------------------------------------------------------
The question: How i can delete [LotName2=Lot 3] value from this cookie?
please reply me quickly.
Thank you
Best Regards
Abdullah S. Abdelhay
|
|
|
|
|
I am going to assume that the cookie contents arn't exactly as you typed it...because it seems there are a few typos in it. The following should work:
string cookie = "LotID1=7&LotNo1=003462&LotName1=Lot 7&BuyPrice1=850&StockQuantity1=56&LotID2=5&LotNo2=003859&LotName2=Lot 3&BuyPrice2=154&StockQuantity2=2";
string[] values = cookie.Split('&');
string[] newValues = (from cv in values
let eqIdx = cv.IndexOf('=')
let name = cv.Substring(0, eqIdx)
let value = cv.Substring(eqIdx + 1)
where name != "LotName2"
select cv).ToArray();
string newCookie = String.Join("&", newValues);
|
|
|
|
|
in Fact you cannot delete value from a cookie but
you should have to recreate the cookie with the new value as explained by the previous post.
Rama Charan Prasad
"Be happy and Keep smiling.Thats what u want be always.. "
|
|
|
|
|
We cannot delete a cookie actually. But one thing we can do is like, we can set the expiry date of the cookie to prior date, so that the browser will remove the cookie when it access the cookie for the next time, since it is expired.
Expiring the Cookie in Server Side:
if (Request.Cookies["MyCookie"] != null)
{
HttpCookie myCookie = new HttpCookie("MyCookie");
myCookie.Expires = DateTime.Now.AddDays(-1d);
Response.Cookies.Add(myCookie);
}
<u>Expiring the Cookie in ClientSide Side:</u>
<script type="text/javascript">
<!--
deleteCookie('MyCookie');
</script>
Please reply on any doubts. Hope this will be usefull for you.
Thanks,
Rajdev KR
|
|
|
|
|
hi all
This is my first question in the forum. i want to ask how to work with excel file independant of version problem in asp.net 2.0 like while reading excel file.?
Nitin
|
|
|
|
|
You need to install Excel on the web server on which you are developing asp.net application, so just install the latest version - 2007, and its backward compitable. so it can handle all the files of ,whatever version.
|
|
|
|
|
Hi,
Can I please hear your views in using the MVP and MVC pattern? I want to use the web client software factory or ASP.NET MVC, but not sure which way to go. The website is a rather huge website. I was thinking to go woth the WCSF for now, and wait till ASP.NET MVC is in a more stable condition and then convert?
I have ready many articled on MVP and MVC, but still there is a confusion as to which one to use. WCSF makes use of DLLs which in my mind is faster, in the ASP.NET samples that I have see the code is just placed in folders, so because they are not already DLLs, wont it take longer to run?
Regards
Brendan
|
|
|
|
|
I have made many (over 50) asp.net applications both large and small. I have never seen the value in MVC or MVP.
I do separate the presentation and data layer and I implement themes. I use a master page and base page whenever possible and put all styling in the css file(s) in a theme. This makes it easy to change the presentation.
Adhering to a specific framework just seems to make more work without providing much benefit. The frameworks are good for developers who are less experienced with ASP.Net but if you know what you are doing than there is no need to constrict your development. Sometimes you just want to code a bit differently.
As for dlls, if you do not compile your website and just place code files IIS will compile the page the first time it is requested. The only advantage to compiling a web site is that the first user doesn't have to wait for it to compile.
I didn't get any requirements for the signature
|
|
|
|
|
|
|
I would suggest by reading one of the articles here http//www.asp.net.
|
|
|
|
|
Hi all,
I have deployed one application on server reside in US,now problem is that when any person using this site from india and he save some data in current date but my application is deployed on US Server so it takes system date of that server which is about one day b4 in some cases and when user search that data in this date he could not get it,is there any way to remove this complexity
N!dh!
|
|
|
|