|
hi,,
I'm new in .Net, any one help me...
how to add multiple rows on the single datatable. without using SQL-Server.
I need to add the multiple textbox values to the Datatable.
Thanks.
|
|
|
|
|
Why do you need to add rows to a data table without using SQL Server ? Is this a homework assignment ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
what are you exactly looking for. If datatable schema is defined use
DataRow dr = dt.NewRow()
then assign values to the fields of dr.
Finally
dt.Rows.add(dr);
you are done.
|
|
|
|
|
hello
i have a problem
i want to display image in label by retriveing the upload photo path from database i used the select path from database and reader but this is not working
|
|
|
|
|
A label cannot show an image. If the image is in the DB, you need to write a page that returns the image from the DB based on an id on the URL, and make that what an img control points to as a source.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
so i need to display an image in one page when clicked in gridview row and taking image from folder and image path is saved in database how can i retrive image
|
|
|
|
|
Rajee Maharjan wrote: how can i retrive image
Well, it's in the database, so you get it back with SQL. And then you access it in the way I told you.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i use the code
while dr.read()
response.write(dr("imagepath").tostring())
end while
when i run not executing inside the loop what happened
|
|
|
|
|
It appears you have no idea what you're doing. I mean your ability to understand how to use an internet forum, not your code. However, I also don't see how this code is a response to my advice. Is there any point in trying to help you ? Do you know anything about programming at all ?
A response.write is useless. You need to set the content type and write it as binary data, not as a string.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi
i am working on a page to show how many time this page is visiting..
how can i do it..
i applied this by adding 1 on opening this page. but on revisiting this link how i prevent to increment no of view on same user
|
|
|
|
|
You would require the user to log in, and only count logged in views. Or you could store a cookie and hope they support cookies, that they don't have more than one PC and that they never delete it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
you can use database table too store the value
One person's data is another person's program.
--J.Walia
|
|
|
|
|
iam adding items to the dropdownlist using javascript function while loading the page.using the webservice.now when click on save button how can i get the value selected in the dropdownlist in the code behind,my problem is that the value selected in the dropdownlist is getting null when i accessing through code behind
|
|
|
|
|
Show the code for both JavaScript and Codebehind ( just adding item in Dropdown and Retreving from it ).
|
|
|
|
|
in javascript
=============
<script type="text/javascript" language ="javascript" >
function AddItem()
{
var opt = document.createElement("option");
document.getElementById("DropDownList1").options.add(opt);
opt.text="One";
opt.value="One"
var opt = document.createElement("option");
document.getElementById("DropDownList1").options.add(opt);
opt.text="Two";
opt.value="Two"
var opt = document.createElement("option");
document.getElementById("DropDownList1").options.add(opt);
opt.text="Three";
opt.value="Three";
return false;
}
function GetDropDownValue()
{
alert("h")
var ddlValue;
var objControl = document.getElementById('<%=DropDownList1.ClientID %>');
alert(objControl.selectedIndex)
ddlValue=objControl.options[o
bjControl.selectedIndex].value;
document.getElementById('hfldResult').value = ddlValue;
}
</script>
in code behind
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim tJavaScript As String = ""
tJavaScript = "<script language='javascript'>GetDropDownValue();</script>"
Page.ClientScript.RegisterStartupScript(Me.GetType, "abc", tJavaScript)
End Sub
|
|
|
|
|
lakshmichawala wrote: document.getElementById('hfldResult').value = ddlValue;
So, are you accessing this control, or the drop list in your code behind ? You have not posted that code, that I can see.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
ya in hidden field iam giving the ddl selected value but iam getting null while accessing the value
|
|
|
|
|
Are you trying to make it impossible for people to help you ? How about posting the code you use to access the value, the script for the control, etc. Why are you not using the client ID from the server to access the hidden field, but you do for the drop down list ? Have you inserts js code to make sure the right control is being found and it's value set ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I really don't understand what you are doing.
lakshmichawala wrote: var opt = document.createElement("option");
document.getElementById("DropDownList1").options.add(opt);
Where you actual create the DrodownList list?
Sometimes you are get taking
document.getElementById("DropDownList1")
and some time
document.getElementById('<%=DropDownList1.ClientID %>');
Please be specific what is your actual requirement is. As per my understanding You have a Dropdownlist ( Server Side Control ) you add value in the list from JavaScript. Now you want to access the value from Code behind itself. Correct me if I am wrong.
|
|
|
|
|
lakshmichawala wrote: document.getElementById("DropDownList1").options.add(opt);
access your dropdown in javascript
document.getElementById("<%=DropDownList1.ClientID %>").options.add(opt);
I dont think that your value is getting updated in dropdown
Cheers!!
Brij
|
|
|
|
|
tq i hv solved my problem using request.form in my code behind
eg:
request.form("dropdownlist1")
|
|
|
|
|
Great
Cheers!!
Brij
|
|
|
|
|
Hi, i know that i should ask this q from sqlserver not asp.net but plz help
Is there a way to restore only one table from a DB backup.
I need restore one table not database because I have update others tables in this database.
thanks in advance
kinds regards
|
|
|
|
|
Ptvce,
ptvce wrote: i know that i should ask this q from sqlserver not asp.net but plz help
This question is Nothing to do with ASP.NET. The best forum is General Database.
ptvce wrote: Is there a way to restore only one table from a DB backup.
I don't think you can restore only one Table from a database. The beast you to generatet the script for the particualr table and run the script in new table. And For restoring the data inside the table you have instert the using script only.
Thanks.
|
|
|
|
|
thanks ur help, thats right, i solve it
|
|
|
|