|
Running Vista ( business ) , SQl 2005 and VS 2005 (VB.net)
I apoliguise if this is posted in the wrong forum
Ok im trying to create an asp.net page that has a 'text' box on it ( no data grid ). in the vb code ( i believe its called code behind ) i have connected to a data source and created a data table - dt .. ( code below ). Ive been looking at lots of different articles and all i manage is to go in circles.
Is it possible to write all the 'code behind' and just bind the data to a text box and if so using the code below how can i bind the field Licence to the text box StrLicence
Alternatly would it be more productive to look at just the asp code, and if so how can i do the same with out using the Form View
Any help would be most appriciated
Vb code
Dim Conn As SqlConnection = New SqlConnection(connectionString)
Try
Conn.Open()
Response.Write("SQL Connection = " & Conn.State.ToString)
Dim Adapter As SqlDataAdapter = New SqlDataAdapter(SelectCommand, Conn)
Try
Adapter.Fill(dt)
Response.Write("Filled Data Table")
Catch ex1 As Exception
Response.Write(ex1.Message)
End Try
Catch ex As Exception
Response.Write(ex.Message)
End Try
dt = Nothing
Conn.Close()
Conn = Nothing
I really do need help..... all this computer stuff is way over my head !!
|
|
|
|
|
If all you need is to bind one field from the data base, then filling a datatable may be a bit too much overhead.
But, with your above code, you should be able to bind your text box something like:
<br />
strLicense.text = dt.Rows(0).Items(indexOfYourColumn)
I think that's the syntax, don't have anything handy to check it on.
|
|
|
|
|
Hi Paddy
Thanks for the reply,
Thats a way forward for me, tho i must admit i havent made it fully clear on what im trying to do. I onlu used one text box as an example, there will be about 20 in total with some 300 records in the table, which i need to navigate through, hence i was trying to bind to the text box to the table
Thanks again, i can now see a way forwards
I really do need help..... all this computer stuff is way over my head !!
|
|
|
|
|
Buy a book, or read some articles. In all honesty, stumbling along blindly is just going to cause you all manner of problems...
Doing a wee bit of proper learning and then coding what you need will probably take you about the same time as bumbling along writing buggy code.
|
|
|
|
|
Hello
How can i get previous url in asp.net or javascript. ? I need to track my website visitors from which search keyword they are coming. if they search for mywebsite in google and they clicked on mywebsite link, i need to get the keyword what they searched to reach this page ? any idea ?
|
|
|
|
|
Googled it[^]
CleAkO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
have a page with two frames, one on the left and on on the right. Certain
actions taken in the right side pane need to cause a refresh
Piyush Vardhan Singh
Programmer
TAS NewDelhi
9313077379
|
|
|
|
|
Use Javascript:
window.top.frames['NameOfTheLeftFrame'].location.reload(true);
---
single minded; short sighted; long gone;
|
|
|
|
|
thanks for reply
i whuld like to refresh the frame page via asp.net(server side)
Piyush Vardhan Singh
Programmer
TAS NewDelhi
9313077379
|
|
|
|
|
That is not possible. The frames only exist in the browser, you can't access them from the server.
You can use ASP.NET code to add the Javascript to the page, but the refresh itself has to be done using Javascript.
---
single minded; short sighted; long gone;
|
|
|
|
|
Guys,
We have written an add-on for our webapplication in ASP.NET. It uses some dll's of the main (web)application.
We're now trying to port this add-on to the new version of our main (web)application. (changed the referenced dll's, changed servers, etc.)
It looks fine until we click on the link that calls our add-on.
Following error is in the log file:
"System.Runtime.InteropServices.COMException (0x80020009): Ongeldige zone."
(you can translate 'Ongeldige zone' as 'Invalid zone')
We've tried opening up the directory security, googling, putting the add-on under the main (web)application instead of next to it, ...
Nothing provided any help.
We're guessing it might have to do with the fact that we're now running Windows Server 2003 instead of Windows Server 2000 or it might have to do something with Oracle 10g. (it stops on a method GetDBState , which is in of one of the referenced dll's (not changed in new version dll))
I hope I'm making sense here.
Any ideas that might help?
Thanks in advance for your help!
V.
I found a living worth working for, but haven't found work worth living for.
|
|
|
|
|
hi dear i want to divded frame set into two rows and every rows have two coloumn on same aspx page
Piyush Vardhan Singh
Programmer
TAS NewDelhi
9313077379
|
|
|
|
|
Don't put your entire question as subject.
If you want the rows divided at the same position, you can specify both cols and rows in the frameset, otherwise specify rows and put two framesets inside the frameset.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Hi all,
I am using a grid to display employee info which shows additional info onmouseover of each row.In the page itself i update this additional info when i press a button. The problem is that the info is not updated in the information shown in onmouseover because that row is not reloaded. How do i update a single row!!!
Thankx in adv....
|
|
|
|
|
i have xml file includs menu items
how can i add this file in aspx page to appear as menu
MD_NADA
|
|
|
|
|
if using asp.net 2.0 simply add the menu control your page and provide the source for the control i.e the xml file accordingly in the properties!!
Gautham
|
|
|
|
|
How can i bind values to a textbox using C#?
Gautham
|
|
|
|
|
But Why you want to bind it to textbox ?
Why can't you directly assign values directly to TextBox.Value property ?
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Sandeep,
Let us take this case:
There is a text box in a datagrid.
We can do it using the FindControl method i guess but,
Is there a way like we do for labels?
Example:I have a label1 in my datgrid and if i want a value to be assigned to the label from the databse i give databinder.eval(container.dataitem,"xyz")
Can this be done to the textbox too??
Gautham
|
|
|
|
|
i think you will have to overload that databind method
i have not done it but see following code as a sample
object bound_value_obj = null;
Control ctrl = (Control)sender;
IDataItemContainer data_item_container = (IDataItemContainer)ctrl.NamingContainer;
bound_value_obj = DataBinder.Eval(data_item_container.DataItem, FieldName);
switch (ItemType)
{
case ListItemType.Item:
Label field_ltrl = (Label)sender;
field_ltrl.Text = bound_value_obj.ToString();
break;
case ListItemType.EditItem:
TextBox field_txtbox = (TextBox)sender;
field_txtbox.Text = bound_value_obj.ToString();
break;
}
<l>Thanks and Regards
Sandeep
|
|
|
|
|
|
Hi all,
Can anyone tell me how to get the currency symbol of India .i.e 'Rs' using System.Globalization .I can only find the currency symbol in Hindi,Telugu,Tamil etc but not in India-English.Also not all the nations currency symbols are available for eg:Bangladesh,Cyprus etc ...How to get those?
If anyone knows the answer please let me know.
Thanks in advance
Koushik
|
|
|
|
|
hi
i am developing an app in which i have to place different size of images on different portions of a page based on there width and height for that i have to recognise there size b4 displaying and i dont have images too they are dynamically changed on there urls i have only there urls i used the following method b4 but it dont work for urls
System.Drawing.Image fullSizeImg = System.Drawing.Image.FromFile("c:\abc.jpg");
then
imgWidth = fullSizeImg.width;
but it dont work for
System.Drawing.Image fullSizeImg = System.Drawing.Image.FromFile("http://images.apple.com/itunesaffiliates/US/2005/12/6/NBC/180x150_BattlestarGalactica.jpg");
can any one guide me in this regard or tell me if there is any alternative for this
looking forward
thanks
shezi
|
|
|
|
|
I guess there is an article related to create a thumbnail for an image, using that code snippet you can play around with the size of the image.
Search for it!!!
Gautham
|
|
|
|