|
It depends a lot on your host, doesn't it?
I'm guessing you are using Sql 2005 Express for development? Check with your host - they may have utilities to upsize an Express database to a bonafide Sql Server 2005 installation.
|
|
|
|
|
well you see.
i heard that i had to change my connection string and stuff in all my files(not sure)
change my web.config connection string.(not sure)
this are the 2 procedure i heard that i need to do
however after i done this 2 my web site still look like this =P
www.duoultra.com/miratech
|
|
|
|
|
And what does your host say about this?
|
|
|
|
|
Pasting the connection string is not enough, you must also call the connection string from places to activate the string.
Are you calling the connection string anywhere? If so, please check the script on that side. There are also many online tutorial available on ASP .NET.
Since we did not write the script for you, it is impossible for us to go through the script and find out what is wrong with it. The error you are getting now
is because you have not called the connection string anywhere in your script.
|
|
|
|
|
I guess the original point I wanted to get to was in what medium was your data stored. What are you using in your development environment? Is it Sql Express? Is it full Sql Server?
If it is Sql Express, you are most likely not going to be able to simply copy the .mdf file and expect it to work (even with connection strings pointed correctly). It is likely that your host does not support Sql Express and would not have the necessary services running on their servers for Express to work. That's why I originally said to check with your host.
Typically, a host will support a full Sql Server edition (not the Express edition). In this case, assuming you've purchased Sql Server hosting as part of your plan, you would need to upload the data from your Express file to the host's Sql Server database. Again, I would check with your host on this. It is possible that they have tools to help with this kind of [Express->to->SqlServer] upload.
Once you have the data loaded in the format expected by your host, then you would look to modify connection strings in your application (hopefully you're using the <connectionStrings> web.config section for this) to properly point to the host's database.
|
|
|
|
|
they also replyed me this
Hi:
Thank you for contacting us. The following script is a sample code in web.config file:
<connectionstrings>
<add name="SiteSqlServer" connectionstring="Server=dedicated;Database=DotNetNuke;uid=USERNAME;pwd=PASSWORD;" providername="System.Data.SqlClient">
After this is entered in your connection string, you need to call "SiteSQLServer" to activate the connection string.
Thanks
i would like to know the if the connection string part is to be inputed inside <system.web>or outside.
also any one know how can i call "SiteSQLServer" to activate the connection string.
like how am i supposs do this (maybe a sample?)
|
|
|
|
|
guys help me see if my logic is correct pls:
the web.config connection string is to access the database server.
the connection string in the script is to access the database.
|
|
|
|
|
Hi,
I have to update a dataset. Grid shows in this format and hence Dataset is in this format
10 100
8 70
9 30
when update is done to this, it is such that proc calculates 10 based on 8 and 9 (70+30 =100). the update call is given to sqlhelper class and hence 10 goes I and then 8,9
I need to alter this sort.
Am now going to Dataview for this.
DataView dv = new DataView(ds.Tables[0]);
//apply a sort
dv.Sort = "Lastname Desc";
1.now i need to assign dv back to ds. How do I do it?
Can you help me?
rmr
|
|
|
|
|
Hi,
When my page is in it's Page_Load method (in my code behind file) I need to get inner HTML of a certain element. Actually I need the HTML that my repeater control produces and then save it to a string.
How can I do this? Is the HTML even generated yet at the point in time when Page_Load is called? If not, I can wait 'till anytime in execution, I just need to get the HTML of the repeater control into a string in my code behind file.
/\ |_ E X E GG
|
|
|
|
|
figured it out. I just added a flag to my method that builds the
repeater and added this code to the bottom of that method:
if (render)
{
StringBuilder sb= new StringBuilder();
StringWriter sw= new StringWriter(sb);
HtmlTextWriter hw= new
HtmlTextWriter(sw);
RepeaterPapers.RenderControl(hw);
return sb.ToString();
}
So if render is true, it will return immediately with the html of the
repeater!
/\ |_ E X E GG
|
|
|
|
|
hi to all
I have datagrid with 9 records.i have 3 buttons named as ,view all ,Active,Deactive.
Here my database columns are country,company,logo,status.
If i click view all the records can be viewed pagewise without any error. It is working fine.
The other 2 buttons namely:
Button Active-status is 1
Button DeActive-staus is 0
I have set pagesize= 5 , that is i have 5 records(1,2,3,4,5) in the first page,4 records(6,7,8,9) in second page.
In the first page i have 3 active records (1,3,5), and two deactive records(2,4)
if i click active in the first page only 3 active(1,3,5) should be displayed and if i click deactive only two deactive records (2,4) should be displayed. Instead all the active records(including active records in second page) are also displaying in that page and same problem in deactive also.
similarly,
In the second page i have two actve records (7,9), and two deactive records(6,8)
if i click active in the second page only 2 active(7,9) should be displayed and if i click deactive only two deactive records (6,8) should be displayed. Instead all the active records(including active records in first page) are also displaying in that page and same problem in deactive also.
My question is i have to display only the active records in the first page.I have set overall pagesize as 5 in my datagrid. How can i set to display only the 3 active records and two deactive records in the first page and same for second page .
I have given the code for Active & Deactive below
ACTIVE BUTTON: (status 1)
Try
strConnString = objCsLgateway.GetConnectionString()
conn = objCsDataBase.GetDbConnection(strConnString)
Dim adap As New SqlDataAdapter("select DISTINCT logo_code,company_name,country_name,category,picture_path from tblLogos where status=1 ", conn)
Dim ds As New DataSet
adap.Fill(ds, "tblLogos")
DataGrid1.CurrentPageIndex = 0
DataGrid1.DataSource = ds
DataGrid1.DataBind()
Catch errEx As Exception
Response.Write(errEx.Message)
End Try
DEACTIVE BUTTON (status 0)
Try
strConnString = objCsLgateway.GetConnectionString()
conn = objCsDataBase.GetDbConnection(strConnString)
Dim adap As New SqlDataAdapter("select DISTINCT logo_code,company_name,country_name,category,picture_path from tblLogos where status=0 ", conn)
Dim ds As New DataSet
adap.Fill(ds, "tblLogos")
DataGrid1.CurrentPageIndex = 0
DataGrid1.DataSource = ds
DataGrid1.DataBind()
Catch errEx As Exception
Response.Write(errEx.Message)
End Try
plz provide me with proper solution and the corrected code.
|
|
|
|
|
|
Hi All,
I have registered javascript function form Page_Load method in my User control.
Is there any way to tell web page which my control belongs to to call this function from body onload event ? I do not have access to the web page and would like to do it from user control.
Thank you very much
Roman
|
|
|
|
|
Hi there,
From the web user control, you can access the web page using the Page property and do what you want. Another option is that the user control can provide an event and have the web page containing the control do the job for the control.
|
|
|
|
|
I have a link for users to download a particular image from my server.
The link control basically looks like the following:
lnkMyImageLink.NavigateURL = "\\serverName\rootFolder\sub2\Folder\images\imagename.tif";
IE seems to know this represents a full filepath however Firefox interprets this as:
"http://www.mySiteName.com/\\serverName\rootFolder\sub2\Folder\images\imagename.tif"
Any idea how to inform Firefox that this is a full image filepath? It's interesting because if you right click in firefox and do a "View Source", the "href" tag looks like "href=\\serverName\rootFolder\sub2\Folder\images\imagename.tif", so I would think that should work but apparently not.
Thanks.
-Goalie35
|
|
|
|
|
I think that because windows explorer and internet explorer are so intwined, when you pass ie a \\servername link, it "converts" itself to windows explorer and handles the link accordingly (e.g. the same as typing it into start > run box). Firefox I don't think can do this. e.g. Type c:\ into the address bars of ie and ff. IE you get standard windows explorer, FF you get a file:/// link and an html representation.
Good luck if you find a solution - I'd be interested myself.
ChrisB
|
|
|
|
|
ChrisB,
You mentioned you were interested in knowing the solution to my problem so here it is:
It actually turns out that although IE accepts this filepath as valid, it's not a good approach to take. So as a different approach, the key is to create a new webpage with the content type set to "application/octet-stream"
-I have a link on my initial page that reads "Click to download file".
-Link to a new aspx webform(I named mine "Download.aspx") & place the url to the downloadable file within either the URL or a session object (mine is within a session).
-Add this code to "Downloader.aspx":
-------------------------------------------
using System.IO;
protected void Page_Load(object sender, EventArgs e)
{
String filepath = Convert.ToString(Session["fileUrl"]);
String filename = Path.GetFileName(filepath);
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
Response.Flush();
Response.WriteFile(filepath);
}
------------------------------------------------
That solved my problem.
-Goalie35
|
|
|
|
|
Goalie35 wrote: the key is to create a new webpage with the content type set to "application/octet-stream"
Of course ! The same method as retrieving an image from a database (like a loadImage.aspx?id=123 page) - replace the page content with the content you actually want to supply.
Thanks for that.
ChrisB
|
|
|
|
|
I've googled etc... but can't find anything relevant.
I have a user control in a master page.
The user control access a session variable which may or may not exist.
If it doesn't exist, the user control doesn't display any content. If it does exist, it displays content.
The problem is that when a page creates the session variable in the postback, the user control is already created and at the time the user control code ran, the session variable didn't exist. This means that although the session variable exists, the user control is not displayed until the user navigates to the next page.
Is there any way to force a user control (which is in the master page) to load after the page code has run?
Thanks
ChrisB
|
|
|
|
|
You can have a method in your usercontrol to reread value of session variable. You can call this method in your code after you write value to a session.
Or you can override Render (or OnPreRender) method of your user control to reread session variable.
These methods are called after postback handlers, so your variable stored in session should already has desired value.
I like this solution more.
class MyControl : UserControl
{
...
...
...
protected override OnPreRender(EventArgs e)
{
// read value from session
SetContent(Page.Session["MY_SESSION_VARIABLE"].ToString());
base.OnPreRender(e)
}
}
Pilo
|
|
|
|
|
|
i use .NET 1.1
im my web site i have a HtmlInputFile
when i upload a small file that's ok
but when i want to upload big files it isn't work
and display "The page cannot be found"
how can i solve it ?
With thanks
MHF
|
|
|
|
|
It sounds like your browser is timing out before the upload has time to finish. You could try displaying an "uploading" page whilst the upload happens, though without your code it is diificult to say exactly what is going on
|
|
|
|
|
is there any where that limit the size of file ?
i use i use
HtmlInputFile.PostedFile.Write Method
MHF
|
|
|
|
|
yes there is a limit on the size of the file, it can however be changed see -
here
|
|
|
|