|
Thanks Christian.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
I am creating Tree view from database.....but its returning only one Parent Node and one Child nodee.......why......this is my code:-
Dim db As Database = DatabaseFactory.CreateDatabase("See2Buy")
Dim cmd As String = "Select Cat.CategoryID, Cat.CategoryName,SubCat1.SubCat1ID,SubCat1.SubCategoryName From Cat INNER JOIN SubCat1 ON Cat.CategoryID=SubCat1.CategoryID ORDER BY Cat.CategoryID"
Dim rdr As IDataReader = db.ExecuteReader(CommandType.Text, cmd)
While rdr.Read
Dim cat As New TreeNode
cat.Text = rdr("CategoryName").ToString()
cat.Value = rdr("CategoryID").ToString()
TreeView1.Nodes.Add(cat)
TreeView1.Nodes.Add(cat)
While rdr.Read
Dim cat1 As New TreeNode
cat1.Text = rdr("SubCategoryName").ToString()
cat1.Value = rdr("SubCat1ID").ToString()
cat.ChildNodes.Add(cat1)
End While
End While
|
|
|
|
|
your SQL looks to me like it will always return one child for each parent.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi all,
I am saving an image in database in the image field but the image is getting saved in hexadecimal form inspite of the field defined as image type. When im trying to show the image through asp.net code im getting an error.
Please help me how i can store the image in database and show it.
|
|
|
|
|
There are two ways to store image in database......First one is to Convert the Image in Binary and store it in Database..........Second way is to store image physically at particular folder location and store Path of that image in Database
|
|
|
|
|
|
Image data type will store the content of an image file in binary format. It will not show you the visual representation of image that you stored in it when you see a record in SQL server.
Post the error message so that someone can help you to get the solution.
|
|
|
|
|
Hi,
This is my code for connecting Mysql with Asp.net.But i get the following error
"ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
My code is as follows:
Imports System.Data.Odbc
Imports System.Data.OleDb
Imports System.Data
Dim sConString As String = "DRIVER={MySQL Server 5.1}; SERVER=localhost;DATABASE=test;UID=root;PASSWORD=denny"
Dim oConnection As OdbcConnection = New OdbcConnection(sConString)
Dim sSQL As String = "SELECT * FROM personal"
Dim oDataAdapter As OdbcDataAdapter = New OdbcDataAdapter(sSQL, oConnection)
Dim oDataSet As DataSet = New DataSet()
oDataAdapter.Fill(oDataSet)
GridView1.DataSource = oDataSet
GridView1.DataBind()
Thanks
Denny
|
|
|
|
|
If you are running this code from your PC, Check whether you have installed ODBC Driver for MySQL.
Control Panel->Administrative Tools->Data Source(ODBC)->Driver Tab
|
|
|
|
|
|
From where can I get ODBC Driver for MySQL
|
|
|
|
|
|
I have a gridview(Gvpatientnm) that has another gridview embedded in it (gviewvisitdetailsinfo)
I have a sub that on the selected index changed that open a detailsview based on the gviewvisitdetailsinfo selected value in a modal pop up window.
I had this working, but it is erractic. I keep getting.
Specified argument was out of the range of valid values.
Parameter name: index
This all happens on selected indexchanged for the gviewvisitdetails grid
here is my code
1. Protected Sub gvVisits_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
2. Dim row As GridViewRow
3. For Each row In gvPatientsNM.Rows
4. Dim gvVisit As GridView = CType(row.FindControl("gviewVisitDetailInfo"), GridView)
5.
6.
7.
8. Dim varVisitid = gvVisit.SelectedValue
9. odsVisitsEdit.SelectParameters("VisitID").DefaultValue = varVisitid
10.
11.
12. Next
13.
14. dviewVisitsEdit.DataBind()
15. dviewVisitsEdit.ChangeMode(DetailsViewMode.Edit)
16. ModalpopupVisits.Show()
17. End Sub
|
|
|
|
|
Which line ? The error means what it says, you should at a minimum always check a value before using it as an index, to make sure it's within the correct range.
Member 1832081 wrote: odsVisitsEdit.SelectParameters("VisitID").DefaultValue = varVisitid
I'd say either varVisitid is not a right value, or VisitID is not found. You should break this code down and write it so it is safe. Then try to work out why it's failing.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
it's telling me it for this line
<pre> dviewVisitsEdit.DataBind()
Even if I take that out I still get it.
I have narrowed down the issue a little further.
If I only have one row in my top level Gridview - gvpatientname it works fine.
If I have 2 rows in the gvpatientnm grid Then the selected row for the embedded gridview -gvvisitdetails
stays selected if I change from one patientname row to another. So the gvvisit could have two rows selected under two patients.
Let me try to illustrate
gvpatientnm
PatID Name
1 Joe Jones
gvvisitsDetails
PatID VisitID
1 1234
1 6783
then for another patient the gvpatiennm gridview and gvvisit gridview are repeated
gvpatientnm
2 Mike Johnson
gvvisitsDetails
PatID visitid
2 4747
Here's a link to a screen shot of the grid
<GridView Pics (opens in new window)
Notice how both edit buttons are able to be selected, this causes a problem when I try to send the selected value to
my detailsview - dvvisitedit.
I am not sure how the best way to handles this is??
Help is appreciated.
Thanks
|
|
|
|
|
Got it to work
Dim gv As GridView = DirectCast(sender, GridView)
odsVisitsEdit.SelectParameters("VisitID").DefaultValue = gv.SelectedValue
dviewVisitsEdit.DataBind()
dviewVisitsEdit.ChangeMode(DetailsViewMode.Edit)
ModalpopupVisits.Show()
|
|
|
|
|
I want to create Tree through Database.........For Root nodes i wrote this code....can anybody guide me how to make child nodes.
i hav category(cat_id,cat_name),
sub category(sub_cat_id,cat_id,sub_cat_name) tables
under category node i have to fill subcategory names as child node
con.Open()
cmd = New SqlCommand("select cat_id,cat_name from tbl_category order by cat_name", con)
dr = cmd.ExecuteReader()
While dr.Read()
cat = New TreeNode()
cat.Text = dr("cat_name").ToString
cat.Value = dr("cat_id").ToString
TreeView2.Nodes.Add(cat)
End While
dr.Close()
con.Close()
|
|
|
|
|
Use this query to get the results
SELECT
Category.cat_id, Category.cat_name, SubCategory.Sub_cat_id, SubCategory.sub_cat_name
FROM
Category
INNER JOIN SubCategory ON
Category.cat_id = SubCategory.cat_id
ORDER BY
Category.cat_id
Now, loop through the results and while the catid is same add the subids as child nodes
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
2).An application using cookie authentication was working fine on another server. When moved to a new server cookie authentication is not working correctly.Which one of the following is the likely explantion of the above problem?
a).The new IIS server is not configured to allow anonymous access.
b).passport authentication is not correctly configured
c).The users are not correctly entering their password
d).The IP address of the new server does not match the prior server IP address.
e).SSL is not properly configured
Thanks,
L
|
|
|
|
|
Have you had your job interview yet ? Some of these options are ridiculous, and if you don't know the answer, you don't deserve the job. Can you tell us which ones can't possibily be the issue, and why ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I am thinking of either it could a or e. I found this some online site.
|
|
|
|
|
OK, I'd guess at a, and the ones in the middle, included the ones that seemed stupid. If you just found this on some site, I'm not sure why you're asking, but the question would be, why would this stop cookies from working ? I would assume that if you need cookies to login, and the site does not allow anonymous access, that neither condition can be met before the other is. But, I admit to not really knowing for sure. I could just see that some of the answers given were obviously not right.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hello,
I am working on an asp.net page and I have a multiline text box that displays some text. I want the user to have to scroll all the way to the bottom before I display a checkbox for them to continue. My question is how can you tell if the scroll bar is at the bottom?
|
|
|
|
|
Have a look here[^], maybe it will help you.
only two letters away from being an asset
|
|
|
|
|
Thanks for the reply. Well, I don't think I want the position of the browser window. I need to know when a user has finished scrolling to the bottom of the textbox control. So, I think I'd need the scrolling locations inside the textbox control only. I also don't know how to trigger this.
|
|
|
|