|
is the event handler hooked up to the grid view in the markup? (or added via code)
|
|
|
|
|
Can any one please give me coding of nochex responderurl varialble's page.
Thankx in Advance
|
|
|
|
|
Hi dear,
I am new to asp.net.
What would be ERD for online admission form for an educational institute.
regards
adil
m.adil.farooq
mcs & acca
adil-farooq@maktoob.com
|
|
|
|
|
Whts ur requirement. Which info do u want to keep in record.
|
|
|
|
|
did you mean Entity Relationship Diagram !!!!
Pavan Pareta
|
|
|
|
|
Yar Which Information do u want to save. Entities ?
|
|
|
|
|
thanks for your reply.
I got an assignment.... to design a online application form for an educational institute.
Please advise me your email address please ..i will send u request in complete detail.
hoping for your kind words.
regards
adil
|
|
|
|
|
|
Unfortunately you cannot insert pictures into standart <input type="text"> .
I can propose to search HTML editor tool (for example KTML) or write something similar with reduced functionality by yourself.
|
|
|
|
|
Sir,
I am developing an application in ASP.NET.It's using a MS-Access database and I am listing ten Emp_IDs from the table Employee to DropdownList.I want to select particular Emp_Name from Employee table on click on DropdownList. Pleas help me to solve this problem.
Praveen.K
System Engineer
Graviton Technologies Pvt.Ltd
|
|
|
|
|
What do u want to do??On select index change of combo u want to display the selected employee details or something else??
|
|
|
|
|
Make the auto post back of drop downlist true and use dropdownlist selectedItem prepertyn in the dropdownlist_selectedIndexchanged function ?
|
|
|
|
|
Your probelm is not clear when and why you want to select employee , please explain your question.
If you are filling dropdownlist use its property autopsotback=true which is false by default.
Now use SelectedIndexChange event of your dropdownlist.
if you have fetch data from database on the basis of rowselected in the dropdowlist.
You have to keep in mind that weahter you are using DataTexFiled property and DataValuefield property of the Dropdownlist
if you are using these two then you can query your database like this
sql="select * from tbl where field="+ dropdownlist.selectedValue or
sql="select * from tbl where field="+ dropdownlist.selectedItem
if you are not using these two properties then
you can use
sql="select * from tbl where field="+ dropdownlist.Text
Hope it will help you .
Naveed Kamboh
|
|
|
|
|
By using SQLString = "SELECT Name FROM test WHERE ID = +DropDownList1.SelectedValue"
I got the selected item from dropdown list.Now how can i place the out put of the query in a DataGrid? i want the syntax or coding?
-- modified at 23:32 Thursday 1st February, 2007
Praveen.K
System Engineer
Graviton Technologies Pvt.Ltd
|
|
|
|
|
I want a column in my datagrid to be edited by a drop down list.
I've put the dropdown list in the edititem template.
The contents of the DropDown is sourced from an SQLDataSource
And the data bindings set up a two way binding to the "Record" field.
I have added this update control parameter
Where:
"Recorded" is the Parameter name.
"gvOutgoing" is the GridView
"Selected Value" is the feild i want from the dropdownlist
<br />
<UpdateParameters><br />
<asp:ControlParameter name="Recorded" controlid="gvOutgoing" propertyname="SelectedValue"/><br />
<UpdateParameters><br />
This generates no errors except it passes a NULL value to @Recorded
Now I originaly thought i should put "ddlRecorded" (the drop down list) in the "controlid" as thats what i want the actaul value of.
except it kept giving me this error:
Could not find control "ddlRecorded" in ControlParamert "Recorded".<br />
<br />
Any adivce?<br />
<br />
Cheers
|
|
|
|
|
Because you want to get the value from the dropdownlist then the ControlID should point to this control, not the GridView. However, the dropdownlist is contained inside the GridView, therefore the value of the ControlID will be the uniqueID of the dropdownlist including the id of the containers. So it should be something like gvOutgoing$ctl02$ddlRecorded (or you can replace the $ with the : ). There's one more important thing is that the uniqueId of the dropdownlist varies from row to row, so you'll have to update the ControlID dynamically according to which row is being edited.
|
|
|
|
|
THANK YOU SO MUCH!
I've been pulling my hair out all day over that
Could you point me to some reference about this so I could understand why it works and possibly find a way to generate that automaticly?
Thanks again
|
|
|
|
|
|
Hi Everybody
I got a TextBox under a Button on the form, talking ID number from the TextBox for creating a Report. If I change the TextBox value then reportviewer cant change the Report it remain same. I put some ToggleBreak point to see the code is working or not, code change the value and working but cant show it on ReportViewer.
FirstTime: TextBOx(CustomerID) = 10, Getting all details about customer whose ID 10
SecondTime: TextBox(CustomerID) = 20, cant getting the Report about CustomerID 20 , its remain same.
I need your help
Thanks
Sarfarj Ahmed
|
|
|
|
|
HI
i think the object in which you are getting the report is not refreshing can you post the code where you are geting report and displaying it ?
|
|
|
|
|
Hi Sandeep
Please check the code and let me know
Thanks
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.Reporting.WebForms
Partial Class Member_Members
Inherits System.Web.UI.Page
Protected Sub btnSearchMember_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearchMember.Click
Dim con As DataAccess = New DataAccess()
Dim conLessons As SqlConnection = con.SQLConnnect()
Dim cmd As SqlCommand = New SqlCommand()
Dim _DataReader As SqlDataReader
Dim _DataSet As DataSet = New DataSetMember()
Dim _ReportDataSource As ReportDataSource = New ReportDataSource()
Try
conLessons.Open()
cmd.CommandType = CommandType.Text
cmd.Connection = conLessons
cmd.CommandText = "Select AutoID, ForeName, SurName From Members Where AutoID=" & TextBox1.Text & ""
_DataReader = cmd.ExecuteReader()
_DataSet.Tables(0).Load(_DataReader)
_DataReader.Close()
conLessons.Close()
ReportViewerMembers.LocalReport.ReportPath = Server.MapPath("~/Member/ReportMembers.rdlc")
_ReportDataSource.Name = "DataSetMember_Members"
_ReportDataSource.Value = _DataSet.Tables(0)
ReportViewerMembers.LocalReport.DataSources.Add(_ReportDataSource)
ReportViewerMembers.LocalReport.Refresh()
Catch ex As Exception
If conLessons.State = ConnectionState.Open Then
conLessons.Close()
End If
End Try
End Sub
End Class
Sarfarj Ahmed
|
|
|
|
|
Hi Sarfaraz
please debug it and put a beak point in _DataSet.Tables(0).Load(_DataReader)
and see the latest data is there in the dataset also check your query and value in Textbox1.text ....... as it is in VB i am not getting
|
|
|
|
|
Hi Sandeep
I did it, I can see the latest data inside the code but not on the report viewer
thanks
Sarfarj Ahmed
|
|
|
|
|
hi,
is there any reference or code snippet for the follwing:
Required data is present in an excel sheet, and this data is supposed to be displayed in a datagrid.
Secondly, what if we just want to display only few records of an excel sheet on to the datagrid
c# is the language.
Thanks!
Gautham
|
|
|
|
|
.NET Classes used :
System.Data.DataSet
System.Data.OleDb.OleDbDataAdapter
System.Data.OleDb.
System.IO.StringWriter
System.Web.UI.HtmlTextWriter
This application uses a FileField (UploadFile)(HTML control) , One label (lblMessage), Button (btnSubmit), Button (btnExportToExcel), DataGrid (DataGrid1), This also explains how to upload a file.
Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.IO
Code :
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
Dim intFileNameLength As Integer
Dim strFileNamePath As String
Dim strFileNameOnly As String
If Not (UploadFile.PostedFile Is Nothing) Then
strFileNamePath = UploadFile.PostedFile.FileName
intFileNameLength = InStr(1, StrReverse(strFileNamePath), "\")
strFileNameOnly = Mid(strFileNamePath, (Len(strFileNamePath) - intFileNameLength) + 2)
Dim paths = Server.MapPath("/excelreading/")
paths = paths & "Excel/"
'If File.Exists(paths & strFileNameOnly) Then
'lblMessage.Text = "Image of Similar name already Exist,Choose other name"
'Else
If UploadFile.PostedFile.ContentLength > 40000 Then
lblMessage.Text = "The Size of file is greater than 4 MB"
ElseIf strFileNameOnly = "" Then
Exit Sub
Else
strFileNameOnly = Session("AdminID") & "-" & Session("Acountry") & "-" & Format(Date.Today, "mm-dd-yyyy").Replace("/", "-") & ".xls"
UploadFile.PostedFile.SaveAs(paths & strFileNameOnly)
lblMessage.Text = "File Upload Success."
Session("Img") = strFileNameOnly
End If
End If
'End If
Dim myDataset As New DataSet()
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("/excelreading/") & "excel/" & strFileNameOnly & ";" & _
"Extended Properties=Excel 8.0;"
''You must use the $ after the object you reference in the spreadsheet
Dim myData As New OleDbDataAdapter("SELECT * FROM [Sheet1$]", strConn)
myData.TableMappings.Add("Table", "ExcelTest")
myData.Fill(myDataset)
DataGrid1.DataSource = myDataset.Tables(0).DefaultView
DataGrid1.DataBind()
End Sub
Private Sub btnExportToExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExportToExcel.Click
' Set the content type to Excel.
Response.ContentType = "application/vnd.ms-excel"
' Remove the charset from the Content-Type header.
Response.Charset = ""
' Turn off the view state.
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
' Get the HTML for the control.
DataGrid1.RenderControl(hw)
' Write the HTML back to the browser.
Response.Write(tw.ToString())
' End the response.
Response.End()
lblMessage.Text = "For any more information , feel free to contact ...!!!"
End Sub
ref : http://www.dotnetspider.com/kb/Article361.aspx
Parwej Back...............DON of Developer.......
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|