|
Just another example of how dependent I have become on intellisense.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
hai
dont use databind ,use
sqldatareader dr;
while(dr.read())
{
ddl.items.add(dr[0].tostring())
}
the above code may help u
with regards
|
|
|
|
|
My Code
'Create to Header Cells
Dim cell1 As New TableHeaderCell
cell1.Text = "Model Name"
Dim cell2 As New TableHeaderCell
cell2.Text = "Quantity"
'Create New row and add the Header Cells to the row
Dim Myrow As New GridViewRow(-1, -1, DataControlRowType.Header, DataControlRowState.Normal)
Myrow.Cells.Add(cell1)
Myrow.Cells.Add(cell2)
GridView1.showheader=false 'Hide the original header
GridView1.Controls(0).Controls.AddAt(0, Myrow) 'Add my Header Row
GridView1.AllowSorting = True 'Allow Sorting
I need to allow sorting through the new row
It doesn't work
Please help
Eric H.
|
|
|
|
|
You need to write code to handle the on sort event. In that event you should use a dataview and sort it then bind the data to the grid. Check MSDN for on sort events in gridviews.
-- modified at 11:17 Tuesday 21st November, 2006
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Please help on this I do not really understand how to do.
I understand that I have to write
Public Event Sorted As EventHandler
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim instance As GridView
Dim handler As EventHandler
AddHandler instance.Sorted, AddressOf func1
end sub
1) what is func1 in my case?
2) How do I link this to the hedearcell of the new header row that I add to the sorting event?
PLease help
-- modified at 4:55 Wednesday 22nd November, 2006
Eric H.
|
|
|
|
|
In my application, initially i disabled backbutton function. Now i want to enable it. This command "private void DataGrid1_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)" is not firing second time when i am clicking the linkbutton in datagrid. In datagrid, some records will be displaying, we will open the records by the name. The record details will be opened in diffrent page. Then, if i want to open another record, i have to go back by clicking BackButton. If i click another record, the previous record only opens.
Prabhakaran.
|
|
|
|
|
Convert the column with that button to a template column. Double click the link button in design view to get a method for the button in your code behind.
In the code behind LinkButton lb = (LinkButton) sender;
you can use that to get to your command argument. lb.namingcontaine or parent contrails the gridrow so you have access to that as well. I never use the item command.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Hi,
I have an SP which provides all the data for a datagrid to be populated(Just like a view). With a view, I would just say something like:
Select * From vw_View
And then fill a dataset..
What is the deal when I need to use a Stored Procedure instead of a view? How do I retrieve the info?
Thanks.
|
|
|
|
|
Hi,
If you want a result from stored procedure just run the select query in the store procedure and use the data adapter to fill a dataset. As easy as it sounds.
Hope i am clear enough.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Thanks for the reply!
Here what I have when I use a view:
<br />
Dim ds As DataSet = New DataSet<br />
Dim Conn As SqlConnection = New SqlConnection(WebConfig.ConnectionString)<br />
Dim sTable() As String = {"tblRequest"}<br />
Dim sSql As String<br />
<br />
sSql = "SELECT * FROM vw_Quote2 "<br />
<br />
If iProjectID > 0 And iStageID > 0 Then<br />
sSql = sSql & " WHERE inProjectID = " & iProjectID & " AND inStageID = " & iStageID<br />
ElseIf iProjectID > 0 And iStageID = 0 Then<br />
sSql = sSql & " WHERE inProjectID = " & iProjectID<br />
End If<br />
<br />
sSql = sSql & " Order By vchStageNumber"<br />
<br />
SqlHelper.FillDataset(Conn, CommandType.Text, sSql, ds, sTable)<br />
<br />
Return ds
Now that I am useing the SP, I have All my SELECT statements in there BUT, I do not have the conditions for those 2 Dropdowns. I dont know how to encorporate them. Also, I do not know how to use the SP in this case.
Sorry if I sound a bit dumb, but things arent clicking with me lately. I am finding it very hard to understand get my head around SPs
Thanks again!
|
|
|
|
|
Dayekh wrote: sSql = sSql & " WHERE inProjectID = " & iProjectID & " AND inStageID = " & iStageID
What is it with people injecting crap into their SQL Strings? This way lies SQL Injection Attacks!
Please, please, please will people learn about how to secure their database from attack: SQL Injection Attacks and Tips on How to Prevent Them[^]
|
|
|
|
|
Thanks for informing me of this .
As you have realised, I am quite new to SQL .
It was quite interesting to read about the Injection Attacks .
But be wary mate, there will always be people who are unaware of this
Thanks again. I will see how I can change it. 
|
|
|
|
|
Dayekh wrote: But be wary mate, there will always be people who are unaware of this
The number of people that were unaware seemed to be going down for a while and in the last few days there has been a spate of people that have really compromisable code.
I'll just have to keep up the fight to ensure that as many people understand what a SQL Injection Attack is and how to write better code.
|
|
|
|
|
Hi,
First of all, write a store procedure that will contain all the queries in your view. If you want to check some condition
you can do it in a stored procedure too. (iProjectID and iStageID). You will have to learn the sql syntax of IF statements.
The values which i told you in last sentence, will be passed as input parameters to the stored procedure. This can be done
as told by other poster, using the command object and setting its CommandType property to StoredProcedure. Then add the
parameters to be passed to the stored procedure.
One of the things you might be wondering about, how to return multiple rows from a stored procedure. If you just
execute the query from SP and fill dataset using data-adapter, then you will get data tables for all your queries in the dataset.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Thank you mate! I didn't realise SPs can be so flexible. I will surely have a crack at that.
Also, to the fight against injection attacks.. Keep up the good work! 
|
|
|
|
|
create your command the same way, then set it's CommandType as System.Data.CommandType.StoredProcedure.
Add the parameters to the command's Parameters using .Add();
then do an ExecuteReader().
|
|
|
|
|
I'm still not done here by the way.. feel free to read my question 
|
|
|
|
|
hai every one
i need a coding for textbox which allows only 30 characters including white space and it should block special characters.
thank u
Dhatchinamoorthy.R
9894824838
|
|
|
|
|
Which special characters?
|
|
|
|
|
|
Hi
I'm developing an application wherein I'm calling some classes in webforms which do some searching,addition etc on the database. Now what I need to know is how can I code the classes in such a way that if I need to call these classes through web service I won't have to redo the code.
Thanks
Don't Quit
|
|
|
|
|
Encapsulate the functionality in a class, then use that class in any project. You can add the class to the GAC or simply use xcopy.
|
|
|
|
|
Hi, Firstly thanks for replying. I'm already aware of these things what I'm asking is can a single class serve both webservice & web form. As in a web service syntax is little different like [WebMethod] attribute etc.
Regards
Don't Quit
|
|
|
|
|
I have hosted a site and they have given 5 email id to put my mail. how can i check that mail from my application. can i assess these mails from my application. plz. provide some tips.
Bharat Bhusanam
|
|
|
|
|