|
i want to save Audio and Video Files To the Database and And Later i want to play that Files how to do that in ASP.NET
sdfsdf
|
|
|
|
|
As for saving the files, u don't save the auio file to the database, u just save its path on the server so what u need is to upload the file on the server in a path using any file upload script then u play it calling it from it's path
Best Regards
3ala2
|
|
|
|
|
Hi,
I think you must use Windows Media Services for online play audio and video file's. I'm not recommend save audio and video file's in DB. I think you must save path to file's in DB.
|
|
|
|
|
hi,
friends i m facing problem in binding dropdown listbox with two tables. table A and table B. i m succeeed in reterieving data frm both tables in a dropdown listbox but not able to fatch their id's. and i want that content of table A is parent & contant of table B is child, means first comes parent then in next row its child content will com from second table who's id is same as of parent id.
pls help me .
waiting for rply.
thanx
bye.
rahul saini
|
|
|
|
|
What is the query you are using and what is the output that you require?
Post some code, that will help us help you.
Shreekar
http://shreekarishere.blogspot.com
|
|
|
|
|
Dim DS As DataSet
Dim MyCommand As SqlDataAdapter
'create connection
Dim MyConnection As SqlConnection
MyConnection = New SqlConnection(Application("dbStrConn").ToString())
'first statement to run
MyCommand = New SqlDataAdapter("select* from jobSectorCategory where jobSectorCategoryStatus='A'", MyConnection)
DS = New DataSet
MyCommand.Fill(DS, "jobSectorCategory")
MyCommand.SelectCommand.CommandText = "select * from jobSectorSubCategory where jobSectorSubCategoryStatus='A'"
MyCommand.Fill(DS, "jobSectorSubCategory")
Dim i, j As Integer
Dim dc As DataColumn
Dim mystrval As String
Dim dt As DataTable
Dim dr As DataRow
For Each dt In DS.Tables
For i = 0 To dt.Rows.Count - 1
For Each dc In dt.Columns
Select Case dc.ColumnName
Case "jobSectorCategoryText"
mystrval = mystrval & dt.Rows(i)(dc.ColumnName).ToString
Case "jobSectorSubCategoryText"
mystrval = mystrval & dt.Rows(i)(dc.ColumnName).ToString
End Select
Next
'Response.Write("ya hai--")
'Response.Write(mystrval)
chooseSector.Items.Add(mystrval)
mystrval = ""
Next
Next
thanx for showning ur interest in my problem.
i m using dis,with dis code i am able to get data but the ordering is not according to want . here first all the records of first table then second table. but i want record of first table as heading of second table.
thanx
waiting
regards
rahul
rahul saini
|
|
|
|
|
monuSaini wrote: mystrval = mystrval & dt.Rows(i)(dc.ColumnName).ToString
Suggestion:
Use a stringbuilder instead of a string when doing big concats.
Having said that, from this code, it seems that you will get a bunch of sectors and sub sectors as a single item in the drop down - is that what you want?
monuSaini wrote: get data but the ordering is not according to want
Further, when you talk about ordering, do you want the sub sectors to be displayed below the sectors? In such a case, what is the relation between these 2 tables - is it Sector ID, - if it is, then a single query should return you the results - show the structure of the tables.
Shreekar
http://shreekarishere.blogspot.com
|
|
|
|
|
Sry for Dat i will remember in future,
sectorTable
sectorId
sectorName
date
subSector Table
SubSectorId
sectorId
subsectorName
date
output should like dis in dropdownlist box
sectorName(a)
subsectorName(a)
subsectorName(a)
sectorName(b)
subsectorName(b)
subsectorName(b)
a & b are sectorId
regards,
Rahul
rahul saini
|
|
|
|
|
Query:
select sectorTable.sectorId Sectorid, sectorName, SubSectorId, subsectorName<br />
from sectorTable, subSectorTable<br />
where sectorTable.sectorId = subSectorTable.sectorId<br />
order by sectorTable.sectorId
Change as per table names and syntax as per database type.
Code for filling drop down:
dim prevsecid as integer = 0<br />
<br />
dr.read (where dr is the datareader object)<br />
prevsecid = dr("Sectorid")<br />
add sector info to drop down (text = sector name, value = sector id)<br />
add sub sector info to drop down (text = sub sector name, value = sub sector id)<br />
<br />
while dr.read<br />
<br />
if prevsecid = dr("Sectorid")<br />
<br />
add sub sector info to drop down<br />
<br />
else<br />
<br />
prevsecid = dr("Sectorid")<br />
add sector info to drop down<br />
add sub sector info to drop down<br />
<br />
end if<br />
<br />
Loop
You can put the foll code in a function for easy reuse
add sector info to drop down
add sub sector info to drop down
If you want the indentation as shown in your post above, add something like "-->" to the subsector name when adding it to dropdown.
Hope this helps.
Shreekar
http://shreekarishere.blogspot.com
|
|
|
|
|
hi,
thanks for dis sollution.
but code to fill dropdown is not working. can u please explain little bit more.
thnkx.
regards
rahul
rahul saini
|
|
|
|
|
Please be more specific as to what is not working.
Post some code that you are using / giving errors.
Shreekar
http://shreekarishere.blogspot.com
|
|
|
|
|
Sub fillSectorDropdown()
Dim DS As DataSet
Dim MyCommand As SqlDataAdapter
Dim MyConnection As SqlConnection
MyConnection = New SqlConnection(Application("dbStrConn").ToString())
Dim sql As String = "select SectorId,SectorName,subSectorId,subSectorName from(Sector, subSector) where(SectorId = subSectorId) order by Sector.SectorId"
MyCommand = New SqlDataAdapter(sql, MyConnection)
Dim prevsecid As Integer = 0
Dim objDR As SqlDataReader
If objDr.Read Then
'While (objDr.Read) 'dis is not working
If prevsecid = objDr("jobSectorCategoryId") Then
chooseSector.DataSource = DS
chooseSector.DataSource = DS.Tables(0)
chooseSector.DataTextField = DS.Tables(0).Columns("Sector").ColumnName.ToString()
Sector.DataValueField = DS.Tables(0).Columns("SectorId").ColumnName.ToString()
chooseSector.DataBind()
'add sub sector info to drop down
Else
prevsecid = objDr("subSectorId")
'add sector info to drop down
'add sub sector info to drop down
chooseSector.DataSource = DS
chooseSector.DataSource = DS.Tables(0)
chooseSector.DataTextField = DS.Tables(0).Columns("Sector").ColumnName.ToString()
chooseSector.DataValueField = DS.Tables(0).Columns("SectorId").ColumnName.ToString()
chooseSector.DataBind()
End If
'Loop
End If
End Sub
i m using dis code please retify dis code
thanx
regards.
rahul
rahul saini
|
|
|
|
|
Sir,
Can i programically delete the history in vb.net.
Thanks
|
|
|
|
|
Hi Friend ,This code may helpful to u
Response.Buffer = True
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1D)
Response.Expires = -1500
Response.CacheControl = "no-cache"
|
|
|
|
|
Sir,
Thanks for ur kind attention.
One more question.
what is the meaning of (-1D) in
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1D)
Thanks
|
|
|
|
|
Hello,open this link to understand the code i send to u
http://www.codeproject.com/useritems/NoCaching.asp
|
|
|
|
|
hi,
How To Programmatically Create a DSN for SQL Server in C# ASP.NET.
kamalnath
|
|
|
|
|
|
Hi,
I am using DataReader to read data from database and comparing the values with textbox values entered(something like in login page to chk whether the user exists)but even the values are same it displays user not valid.
what r the options for comparing values?
herez my code
if((dr.GetValue(0).ToString().Equals(txtUserName.Text.ToString()))&&(dr.GetValue(1).ToString().Equals(txtPassword.Text.ToString())))
{
Response.write("User is valid");
}
else
{
Response.write("User is not valid");
}
Thanks,
Mini
|
|
|
|
|
You can use the string.Compare method to specify if the comparison should be case sensetive or not. Usually the comparison for user name is not case sensetive, but the password is.
---
b { font-weight: normal; }
|
|
|
|
|
Well one another way is that u must compare by applying == among two string like...
dr.GetValue(0)==txtUserName.Text
may be this will helpfull..
KHATRI
|
|
|
|
|
Well you can also compare the two values by applying == to them
Like
dr.GetValue(0)==txtUserName.Text
similarly u can do more..
May be this is helpfull to u
Khatri
|
|
|
|
|
I would suggest that you relegate this task to the database by changing your query and adding filter for username and password (if applicable)
As for comparison, you can make both values upper case/lower case and then compare (if they are strings) or use object comparison (for objects).
Shreekar
http://shreekarishere.blogspot.com
|
|
|
|
|
Try the following code
if((dr.GetValue(0).ToString()==txtUserName.Text.ToString())&&(dr.GetValue(1).ToString()==txtPassword.Text.ToString()))
{
Response.write("User is valid");
}
else
{
Response.write("User is not valid");
}
Thanks and Regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
Thanks to all..
All ur replies r working fine...
Thanks,
Mini
|
|
|
|