|
ffowler wrote: I was going on this idea of keeping things separate (i.e. Database conversations and the like).
Good idea.
ffowler wrote: Can anyone refer another book or article that may give me some more guidance
http://www.codeproject.com/KB/dotnet/n_tier_web_service.aspx[^]
Basically, you would create class dlls, or in VS2005, just classes in the app code area. Then, your pages will just handle plumbing and create business objects. One common way around the fact that pages have no state, is to store all your objects in a database ( this works if your pages are content driven and need a DB to start with, not if you just have a couple of disparate objects ). Then your pages can pass around ids that are used to build objects from the data base.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Bingo! That will do. I do have other documentation on Web Services so I'll go on from here. Thanks again for your time.
|
|
|
|
|
I am new for sqlserver database connectivity.Can any one help me out?
Thanks,
|
|
|
|
|
This is a basic topic. I suggest you read the MSDN documentation, buy a book on ASP.NET/ADO.NET, or do a quick search of the web.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi.
Has percent (%) any special usage in value of querystrings?
when I use for example %a7 as value, the result is a square, why?
Best wishes
|
|
|
|
|
Read this article[^]
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Here's some fun. Assume a parent panel, pnlBody, to which the following belongs.
If I include a panel pointing to a style in my aspx page, ala
<asp:Panel runat="server" ID="pnlHeader" CssClass="Header"></asp:Panel>
and then add a menu to it in code, e.g.
Menu mnu = new Menu();
pnlHeader.Controls.Add(mnu);
everything is groovy. I can then add text by creating labels and adding them to pnlBody.Controls. The end result is a top menu, the end of the menu color scheme (white on blue), and then the text (black on white).
Now's when the adventure begins. If, instead of putting pnlHeader in the aspx page I dynamically create it in code in the same order, the next line of text is formatted in the menu's style, e.g. white on blue.
Panel pnl = new Panel();
pnl.Controls.Add(mnu)
Label lbl = new Label();
lbl.Text = "test";
pnl.Controls.Add(lbl);
pnlBody.Controls.Add(pnl);
Renders fine on Firefox and Safari (menu white on blue, "test" black on white), but in IE7 I get two rows of white on blue (the second line being "test").
I've tried about every permutation I can think of. Do I just write my own menu control and give up on these guys, or am I missing a clever little workaround somewhere?
|
|
|
|
|
I need to make record keys for DataGrid row items available to my client-side code. I've tried adding a template column with a hidden input, and width of zero, but the column still appears in the browser. Is there some better way of sending the record key for a grid row to the client?
|
|
|
|
|
what do you mean
Brady Kelly wrote: DataGrid row items available to my client-side code.
|
|
|
|
|
Let's say a row in the DataGrid contains "Closed Job Report", and the ID for that report is 17. I needed to send that 17 to the client somehow, without including it in a column.
I have found a way, by adding an attribute to the Item in OnItemDataBound, this causes each table row rendered by the grid to have that attribute.
|
|
|
|
|
ah I see what you mean now, well done!!
|
|
|
|
|
Brady Kelly wrote: without including it in a column.
Why not a column that is not visible?
led mike
|
|
|
|
|
Have you tried setting DataKeyField ?
|
|
|
|
|
Hi
I have the following:
SqlDataSource_GridView_roomSchedule.SelectCommand =
"SELECT room_code, room_schedule.parentarea, instance_variant, Room_ID, project_room_description, level, areaslevel3.arealevelid " +
"FROM room_schedule, areaslevel3, areaslevel2, areaslevel1" +
"WHERE room_code like'" + searchroomcode + "'" +
"AND room_schedule.parentarea = areaslevel1.arealevelid AND" +
"areaslevel1.parentarea = areaslevel2.arealevelid AND" +
"areaslevel2.parentarea = areaslevel3.arealevelid AND" +
"areaslevel3.arealevelid in" +
"(SELECT areasLevel3_id" +
" FROM room_schedule_permission" +
" WHERE username = '" + username + "' AND" +
" permission_start_date < getdate()AND" +
" permission_expiry_date > getdate())";
I get the error Incorrect syntax near keyword 'like'.
but when I put this code in sql query analzyer and hardcode the values where string values are it works fine, any help would be appreciated
thanks
|
|
|
|
|
a-+s-+p-+ wrote: "WHERE room_code like'" + searchroomcode + "'" +
I think you need to add '*' to the right and left of the searchroomcode
"WHERE room_code like'*" + searchroomcode + "*'"
if the searchroomcode is not of type string, remeber to call ToString()
"WHERE room_code like'*" + searchroomcode.ToString() + "*'"
I hope this helps
Mohamed Gouda
Egypt
|
|
|
|
|
Use a stored proc and stop writing inline SQL
only two letters away from being an asset
|
|
|
|
|
I found the problem, there was no space bwteen the speech marks so it wasnt reading the statement right
cheers!!
i love inline sql!
|
|
|
|
|
a-+s-+p-+ wrote: i love inline sql!
Why ? You love unreadable code ? Or is the fact that it is unmaintainable that seems so great to you ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
No but the fact I've got twenty different databases using the same code makes writing inline sql the more viable option
I see your job is to provide witty or useless comments on each post especially this page..
|
|
|
|
|
try to do like this
"Select * from Visitors where VisitorName like '" & TextBox1.Text & "%'"
Raghvendra
|
|
|
|
|
I have a datagrid displaying data summary
And when the client selects a row, the details of the selection appears down the datagrid in some text boxes and lables
I want the page to scroll down and the focus is set on one of the details' fields.
Mohamed Gouda
Egypt
|
|
|
|
|
How do you mean the focus is set on one of the fields?
Do you want the user to be able to click on a row and then go to another page with those details?
|
|
|
|
|
a-+s-+p-+ wrote: Do you want the user to be able to click on a row and then go to another page with those details?
No the field is in the same page as the datagrid
but the datagrid has to display 10 records per page, which occupy most of the page.
so the user needs to scroll down to read the details
I need to have that done automatically on the selectedIndexChange event of the datagrid
Mohamed Gouda
Egypt
|
|
|
|
|
ah rite so they click on a link and it takes them down to the next part of the page?
is that right
normally with a hyperlink you would put a # on the end then put a div and name that # i think
|
|
|
|
|
a-+s-+p-+ wrote: you would put a # on the end then put a div and name that # i think
It works but ....
I used Response.Redirect() to achive your idea but the Redirect method resets the selection
Any altrnative to Response.Redirect() ?
M. Gouda
foreach(Minute m in MyLife)
{
myExperience++;
}
|
|
|
|