Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Friday, March 23, 2012

Read datasource value, send to textbox in VB script

I want to read a value from a datasource and send it to a textbox on an ASP page from the page's attached VB file.

Both the textbox and datasource exist, but I don't know the proper commands to get the datasource value and then set the textbox value to it.

Dim Text As TextBox = FormView0.FindControl("Header")

Dim SQL As String = "Select [Customer] From [Datasource]"

Datasource.SelectCommand = SQL

Oh yeah, I don't want the textbox control to be databound as shown:

Text

='<%# Eval("Customer") %>'

Hi phoenix,

ASP.NET provides many ways on Data Binding server controls. As you want to bind data to a textbox from your data table, we suggest that you should create a DataSet which contains the data talbe and filter which row and column would be selected, then evaluate the TextBox control's text property with the selected value.

Ofcause there are may other ways for you to refer, pls check these materials:

http://samples.gotdotnet.com/quickstart/aspplus/doc/webdatabinding.aspx (For Data Binding server controls)

http://samples.gotdotnet.com/quickstart/aspplus/doc/webserverctrls.aspx (For the introduction of server controls)

If this does not help you ,pls feel free to mark the post as Not Answered and reply. Thanks.

Tuesday, March 20, 2012

Reach SqlServer located another server

Hi,

I have a asp.net website and bind it with sqlserver but this sqlserver is located another server different from the server my website is located. So how can i bind them with eachother.

Thanks in advance...

Fine, just specify that server name (which is diffrent than the server where your web application in) in the connection string:

Server=YourDatabaseServerName;Database=YourDatabaseName;User ID= YourUserID; Password=YourPassword
 
Check out his for more examples:www.connectionstrings.com
 
Good luck.
|||

Thanks my friend but i am sorry i forgot to ask my another question about how to connect database if it is different from sqlserver (i mean it can be oracle or something else) located another server.

Thanks in advance again...!

|||

Just visit the link I posted:http://www.connectionstrings.com/

and click on the database that you are using (e.g. Oracle -> usehttp://www.connectionstrings.com/?carrier=oracle ).

Good luck.

Monday, March 12, 2012

RDLC not recognizing DataSet

ASP.NET 2.0 Project
Added
rdlc file
DataSet with DataTable to be populated dynamically at runtime
I cannot set DataSetName in the dropdown -- it does not recognize my
DataSet and I cannot type into it.
If I compile I receive this error for my RDLC
"Error 1 The table 'table1' is in the report body but the report has
no data set. Data regions are not allowed in reports without
datasets."Are you saying that in the "Report Data Sources" window you do not see any
datasets (it actually shows the datatables) in the "Project Data Sources"
dropdown?
Where exactly are you trying to enter this dataset
Do you have an xsd created?
In the datasources window (Which shows when you are looking at a report),
what do you see? And can you create a new datasource from there?
// Andrew
> ASP.NET 2.0 Project
> Added
> rdlc file
> DataSet with DataTable to be populated dynamically at runtime
> I cannot set DataSetName in the dropdown -- it does not recognize my
> DataSet and I cannot type into it.
> If I compile I receive this error for my RDLC
> "Error 1 The table 'table1' is in the report body but the report has
> no data set. Data regions are not allowed in reports without
> datasets."
>

Friday, March 9, 2012

RDLC and Excel - No Grid Lines

Using ASP.NET 2, C#, Web application, we have an rdlc report which will be primarily used to export to an Excel spreadsheet. When we run thw report, then export it, we wind up with a spreadsheet with no gridlines, eg a spreadsheet with invisible cell borders.

Is the a setting or property somewhere which can be changed so that the spreadsheet which opens after the export looks like a standard spreadsheet, that is, with visible cell borders?

Many thanks
Mike Thomas

In the test I just did, setting the BorderStyle to Single on the text boxes I wanted to have borders worked. You should also take a look at http://msdn2.microsoft.com/en-us/library/aa178951(SQL.80).aspx to see how cells are converted. Short and sweet: best, use a table; next best, make sure to align everything.

Larry

|||

Sorry, it's late. I should have also mentioned that every cell in a table and a matrix are textboxes. The BorderStyle is 'none' by default and the BorderColor is 'Black' by default. The properties I mean are those in Visual Studio, not those found through the context menu.

Larry