|
sulabh2020 wrote: What i ans for the connectin doesnt mean that this is the exact and only ans for this post, its a Hint of doing.
OK, well, I pointed out some bad practises in your code, you rejected the claim. It seems that you accept it now ?
sulabh2020 wrote: so every time u have to declare the connection string.
It is always better to expose your connection string in a config file.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
sulabh2020 wrote: public SqlConnection con = new SqlConnection();
string connect= "Server=Server_path;Database=ABC;User=userassword=Password";
con = new SqlConnection(connect);
Looks bad design for me. con = new SqlConnection(connect); is not needed, using this line you are creating one more object for the SQLConnection class. SQlConnection object have a property ConnectionString . Instead of creating new connectiion assign value to this property. Or write connection initialization code after creating connectionstring.
|
|
|
|
|
Hi guys i have a value for example 23 now i display this like "000023.0" length shoulbe be 8. if i give 44.5 means it should display "000044.5", so lenght not exeed 8. please tell me how to display like this.
Praveen Kumar.R
|
|
|
|
|
Same as below - the Format method on the string class, or even the ToString on the int class, can be told what number format is needed.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
Try this
Format(<VariableName>,"000000.00") will give the result.
Regards,
Manowj
|
|
|
|
|
Hi guys i want displat the time like this format "06:12:12000000008" please let me know anybody know. how to write code
Praveen Kumar.R
|
|
|
|
|
Use the string's Format method to build the number in the format you need.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi,
i am trying to export the data from ASP.NEt datagrid to Xls file.
i am recieving this error :
Control 'dgBillsReviewed__ctl2__ctl0' of type 'DataGridLinkButton' must be placed inside a form tag with runat=server.
i am using HTMLtext writer to export the data. i am taking template columns in my grid. if i remove these template columns(when i drctly set the datasource, it is working fine)
please let me know the solution...
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
HI Rahi in ur HTML there is no Form tage so please put form tag and try again may be it will work if ur coding is correct.
Praveen Kumar.R
|
|
|
|
|
Hi,
Confirm that the datagrid is placed in between the <form> and </form>.
Regards,
Manowj
|
|
|
|
|
hi,
thanks for responding to my query.
my grid is placed in the Form Tag. still it is giving this error.
i am using Item Template to bind the data ...and i am using lables to display the grid data.
how to resolve this?? any idea??
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
why Session_End is fired after i deleted a folder using directory.delete(folderpath,true)
|
|
|
|
|
Hi,
This can be any one of the reasons.
(1). Given Session time might be expired.
(2). Time out because of slower response time
(3). Session got destroyed in any part of your code.
Check these.
Regards,
Manowj
|
|
|
|
|
Hi,
I am uploading multiple files from my web application. It is working fine on local pc. But when I am trying to upload file on server it gives erroe as "Illegal characters in path".
Can any one give me solution for this ??
Thanks!
|
|
|
|
|
Maybe U should use this
string path = Server.MapPath(@"~\Your_folder");
"@" means to escape backslash into string. And "~\" means that your files will upload into server folder.
Regard,
Edwin
|
|
|
|
|
if you're using Visual Studio to develop your ASP.Net applications, you may want to have a look at the extremely cool refactoring tools for ASP.Net just made available for free by Developer Express.
Have a look at see this blog entry and don't miss the link to the screencast!
More info can be seen (lots of screenshots) on this page from Mark Miller, the funny brains behind these productivity tools.
|
|
|
|
|
Woah, Thanx Cycnus, how do know about this coolest tool?
This is great!!!
Regard,
Edwin
|
|
|
|
|
I use the components and other tools developed by this company.
The non-ASP tools have lots more features but are not free. They are really cool an useful though and I couldn't do without them.
I love the visual effects too...
|
|
|
|
|
thanks for the infomation
Regards,
Tomi
|
|
|
|
|
Here is what I am trying to do. I am using ASP.NET 2.0. I have created a data set called Stocks data table called Data and put it in the App_Code folder. I am filling the data table from data in a csv file located on the web. I am populating the data table with the following code. This code works because I checked the record count and it shows 21 records for the Data data table.
public static DataSet Convert()
{
WebClient Client = new WebClient();
Stream myStream = Client.OpenRead("http://mysite.com/table.csv");
StreamReader myStreamReader = new StreamReader(myStream);
Stocks myStocks = new Stocks();
string line = myStreamReader.ReadLine();
string allData = myStreamReader.ReadToEnd();
string[] rows = allData.Split("\r\n".ToCharArray());
foreach (string r in rows)
{
string[] items = r.Split(",".ToCharArray());
myStocks.Tables["Data"].Rows.Add(items);
}
return myStocks;
}
I am trying to bind the data in this table to a report. I added a report to my project and selected the fields from the data table. I then added a ReportViewer control to the web form. I’m not sure how to configure the ObjectDataSource that is added to the web form after the ReportViewer control is added. It firsts asks to select business object. I have the following options. I’m not sure what to select.
Stocks
Stocks + DataTable
Stocks + DataRow
Stocks + DataRowChangeEvent
Stocks + DataRowChangeEventHandler
Next I need to define a data method. Not sure what option to select. I just want to bind the report to the data table and return the rows.
Any help would be appreciated. Thanks.
Weste
|
|
|
|
|
Hi,
I have a gridview User enter values into rows and with one button click I Want to save all data to Gridview. I am able to save all data from the Gridview to Database with one click.
Here my problem is :
On the Page_Load I am getting the data from Database. And storing it in the Data Table binding the datatable to Gridview.
The first column of Gridview getting the data from another apsx page. User add one row to gridview enter some data in that row. Again he clicking on addrow button which will add the row to gridview. This time the data entered in previous row is erasing. But
I need to persist the data in the previous row before adding the new row. Atlast I want to update all rows data into database with the Update button click which is outside of grdivew.
How to persist the gridview data.
Thanks
|
|
|
|
|
Since you are binding gridview on page_load , ASP.NET won't maintain it's viewstate. You need to bind it in any event that occurs before viewstate is loaded. Check MSDN for ASP.NET page lifecycle.
|
|
|
|
|
I'm installing a web page based on one of the MS templates at http://msdn2.microsoft.com/en-us/asp.net/Aa336613.aspx(the "personal" template, 2nd one down)
When running the site on the host, I get a "Server Error in '/' Application." error . What is more, the error references a line of code in the App_Code Folder >> PageBase.vb file, specifically
Return HttpContext.Current.Profile("StylesheetTheme").ToString()
If I comment out the property that the above line is from, the page loads, but stripped of any formatting. Now, the odd part is, I don't need any database connection yet for this page - just static pages - so I have removed all Datagrids and such that reference the database.
I'm still a bit fuzzy on how Themes work, except that they are some sort of server-side version of CSS. Any idea what is causing this error? Thank you for any suggestions!
Here is what that whole PageBase file looks like:
Imports System.Web.UI<br />
Imports System.Web<br />
<br />
''' <summary><br />
''' Base class for all pages in the application.<br />
''' </summary><br />
Public Class PageBase<br />
Inherits Page<br />
<br />
''' <summary><br />
''' Override the <see cref="Page.StyleSheetTheme" /> property to use the current user's profile.<br />
''' </summary><br />
''' <remarks>The reason for using the <see cref="Page.StyleSheetTheme" /> property instead of <br />
''' <see cref="Page.Theme" /> is the resulting output:<br />
''' StyleSheetTheme CSS files get output at the very beginning of the <head> element in the source, <br />
''' whereas Theme CSS files get output at the end. We're using IE-specific conditional comments in the <br />
''' masterpage that *must* be interpreted after the main style sheet, so we have to output the link to the <br />
''' main style sheet as early as possible.</remarks><br />
''' <br />
Public Overrides Property StyleSheetTheme() As String<br />
Get<br />
Return HttpContext.Current.Profile("StylesheetTheme").ToString()<br />
End Get<br />
Set(ByVal value As String)<br />
HttpContext.Current.Profile("StylesheetTheme") = value<br />
End Set<br />
End Property<br />
<br />
End Class
|
|
|
|
|
How to create the formatting bar at run time as provided in this site for bold,italic and underline
Thnx & Regards
Manoj Bisht
|
|
|
|
|
Hi
I am fairly new to asp.net ,i am using a grid view to show data from SQL database, I have enabled editing in grid view, when i run it in a browser and try to update any field, i get the error "Updating is not supported by data source 'SqlDataSource1' unless Update Command is specified."
i tried to configure data source >used Query builder>selected update tab>Chose the table which i want to update, and gave the Query as "UPDATE Calltracker SET Badge_numner ="
I am not sure this the way to do it or do we have any other way. and if this a way to update it what the value i should give and how should i give it..Your help will be greatly appreciated
NvN
|
|
|
|