|
|
|
You could try using this:
using(Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer m = new Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer())
{
foreach (ServerInstance si in mc.ServerInstances)
{
Response.Write("ServerInstance:" + si.Name + "<br />");
}
}
You'll probably have to add a Reference to Microsoft.SqlServer.Smo
Best of luck
Cheers
Disgyza
Programmer Analyst
|
|
|
|
|
Hi All,
We are facing below issue in the application. Its happening very seldom and for specific users only.
Out of 100 users it is happening for 1 or 2 users.
In the application when we are making a service call it is throwing this excpetion.
please can any one tell me what can be reason?
I tried google there are many reasons but i am not able to conclude and reproduce the exception.
Its very intresting as its working fine for all other users but for some specific users its not working
The request failed with HTTP status 400: Bad Request. Stack: at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
Thanks and Regards
Sandeep
If 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... "
Check My Blog
modified on Friday, April 24, 2009 1:56 PM
|
|
|
|
|
Seems that you are using webService and for some reason the response returned to asp application is not well formed, maybe the problem could be with the webService. The problem occurs in specific pages? or random pages?
|
|
|
|
|
Thanks for the reply..
Yeah the problem occurs for a specific call in a perticular page...
This call is getting failed only for some users ....
We never got this issue in the QA. But in the production very few users are having this problem.
At our end we are not able to reproduce the issue.
The service that we are calling is third party. There they are saying that they are not getting any request ..
Request is getting failed ....
We are not sure what can be the issue to fix it
Thanks and Regards
Sandeep
If 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... "
Check My Blog
|
|
|
|
|
Well, the problem is with one particular page, one service, maybe one particula webMethod?
Maybe the users with problem has the same work to do, so only them use that part of the webService, that could explain why only they are being affected.
In order to reproduce the bug, you must identifi the webMethod (or methods) and send the same information than the user are sending to receive the same answer from the service.
|
|
|
|
|
Rolcr wrote: the problem is with one particular page, one service, maybe one particula webMethod?
Exactly, only for one perticual webmethod we are facing this issue and only for some users ....
Rolcr wrote: In order to reproduce the bug, you must identifi the webMethod (or methods) and send the same information than the user are sending to receive the same answer from the service.
We knew the WebMethod. and we send the same information data the users are sending and we were able to send that information ...
Thats the problem we are not able to replroduce the issue....
We know issue is there as we are seeing exceptions in the production log
Thanks and Regards
Sandeep
If 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... "
Check My Blog
|
|
|
|
|
|
swetha sankaran wrote: public string RetrieveDataSource()
Remove the brackets.
|
|
|
|
|
Got past the "get" error...I get object reference not set to an instance of an object while trying to render the string within a toolpart.
<br />
public string RetrieveDataSource<br />
{ <br />
get<br />
{ <br />
System.Data.Sql.SqlDataSourceEnumerator en = System.Data.Sql.SqlDataSourceEnumerator.Instance;<br />
DataTable dt = en.GetDataSources();<br />
RegistryKey rk = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft SQL Server");<br />
String[] instances = (String[])rk.GetValue("InstalledInstances");<br />
<br />
if(instances.Length > 0)<br />
{<br />
foreach(string element in instances)<br />
{<br />
if(element != "MSSQLSERVER")<br />
{serverName = String.Format(System.Environment.MachineName,element);}<br />
else<br />
{serverName = System.Environment.MachineName;}<br />
<br />
}<br />
<br />
}<br />
return serverName;<br />
}<br />
<br />
}<br />
<br />
protected override void RenderToolPart(System.Web.UI.HtmlTextWriter output)<br />
{<br />
base.RenderToolPart(output);<br />
if (ex1 != "")<br />
{<br />
output.Write(ex1);<br />
}<br />
output.Write(this.RetrieveDataSource); <br />
<br />
}
Any idea as to why it is happening. Is this a NullReferencException?
Thanks.
Swetha Sankaran
|
|
|
|
|
Its the logic or coding issue it seems ..
Best part is debug and see which object is not initialized or is null
Thanks and Regards
Sandeep
If 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... "
Check My Blog
|
|
|
|
|
String[] instances = (String[])rk.GetValue("InstalledInstances");<br />
<br />
output.Write(this.RetrieveDataSource); <br />
Are the two places wehre the error seems to be happening.
Swetha
|
|
|
|
|
Hi
i have a grid and want to allow paging for my custom object stored in a list... the list has 1000 records and i want to show 50 per page... I did the following
gridview.allowpaging=true;
gridview.pagesize=50;
gridview.datasource=mylist;
currentlist=mylist;
gridview.databind();
it works fine on the first time... when somebody clicks page 2, i called pageindexchanging event and added
{
grid1.PageIndex = e.NewPageIndex;
grid1.DataSource = currentList;
// grid1.DataSource=list
grid1.DataBind();
}
the grid isn't shown at all... i get an empty page... wat should i do;
please provid help
thanx in advance
haseeb
|
|
|
|
|
Check to ensure that there is data in your dataset. It could be that when you postback that your dataset is being wiped.
Are you storing your currentList in the ViewState?
Cheers
Disgyza
Programmer Analyst
|
|
|
|
|
yeah... ur right, my list becomes emptied up because of state issue, but my list is 2000 columns, storing that much data for every user , isn't that a bad idea?
is viewstate created per user, each user will have own viewstate or do i have to save to someother place
thanx...
haseeb
|
|
|
|
|
There are several ways you can do this, each have pro's and con's.
1. You can query the database and return your records for each time the event handler fires. This can be an issue on performance if you have a lot of records being returned. (multiply this by each user using the system).
2. You can set up special queries to return only a set amount of records (only the data grid's page size) this is a better approach because it returns only the records you want to show the user.
3. You can save the information to ViewState, the ViewState stores information about the page using the browsers memory. It has more of a performance hit on the client, instead of the server.
My suggestion if there are a lot of records would be to use option 2.
I'm sure there are quite a few more ways in which this can be accomplished... the easiest way would be to just query the database each time the event fires... but this has performance issues.
Try it out and see what works best for your situation.
Best of luck,
Cheers
Disgyza
Programmer Analyst
|
|
|
|
|
thanx... for this beautiful answer...
i think you are right,i should use option 2, gridview paging ... though , it is not gonna be that easy. and yeah... can u please help me one more thing, i am confused regarding view state, somebody told me that view state is not created for each user, so if ur using sessions, u should not be using viewstate... i thought each session has separate viewstate...
thanx alot...
take care
haseeb
|
|
|
|
|
Hi, I have 3 .resx file, its using for language. For PrecompiledWeb;
I convert "Resource.en.resx" to "Resource.en.resources" using with ResGen.exe.
I convert "Resource.en.resources" to "App_GlobalResources.resources.dll" using with al.exe.
I do this operation for turkish and russian languages. So I have 3 App_GlobalResources.resources.dll for each language.
I paste this dll file in relevant directory. For example; ....\bin\en-US\
But I browse the web site it's not work. May be I merge this file using with aspnet_merge.exe and I get App_GlobalResources.dll but how I don't know.
How do solve my problem?
Not: I check "Allow this precompiled site to be updatable" when publish web site.
MY CODE USING ResGen.exe
------------------------
ResGen.exe en-EN/Resource.en.resx Resource.en.resources
ResGen.exe ru-RU/Resource.ru.resx Resource.ru.resources
ResGen.exe tr-TR/Resource.tr.resx Resource.tr.resources
MY CODE USING al.exe
--------------------
al.exe /nologo /t:lib /embed:Resource.en.resources /culture:en-US /out:en-EN/App_GlobalResources.resources.dll
al.exe /nologo /t:lib /embed:Resource.ru.resources /culture:ru-RU /out:ru-RU/App_GlobalResources.resources.dll
al.exe /nologo /t:lib /embed:Resource.tr.resources /culture:tr-TR /out:tr-TR/App_GlobalResources.resources.dll
Best Regards...
|
|
|
|
|
Hello, I searched and didn't find a good answer to these specific questions so I thought I'd post them here:
- What are some suggestions for the best ways people have used for site design for sites containing asp.net and c#?
- I'm getting more into asp.net using VS 2008 but have used Dreamweaver MX for over 5 years. I'd like to continue to use dreamweaver but also use VS for code development. Is that possible?
- Do most developers just stick with VS for full site design and deployment?
Thanks in advance for your responses and patience with my foolish newbie questions.
-----------
Jeff
|
|
|
|
|
I think each one have their own personal criteria ,
For me, if I have to develop something related with asp I will use only VS because it was specially created for that, I think DreamWeaver was made for design tasks and for static web pages.
Each tool has good function as well as weakness, all depends of your experience with each one.
My personal opinion.
|
|
|
|
|
In windows forms development, is it ever practical to use datasets over class objects to store data? What would you prefer and why?
Thanks
Tina
|
|
|
|
|
don't cross post, it is considered rude.
|
|
|
|
|
i have an asp.net application where i was trying to apply .net compression.
here is the code i used in global.asax
private void HttpCompress(HttpApplication app)<br />
{<br />
try<br />
{<br />
string accept = app.Request.Headers["Accept-Encoding"];<br />
if (accept != null && accept.Length > 0)<br />
{<br />
if (CompressScript(Request.ServerVariables["SCRIPT_NAME"]))<br />
{<br />
System.IO.Stream stream = app.Response.Filter;<br />
accept = accept.ToLower();<br />
if (accept.Contains("gzip"))<br />
{<br />
app.Response.Filter = new System.IO.Compression.GZipStream(stream, System.IO.Compression.CompressionMode.Compress);<br />
app.Response.AppendHeader("Content-Encoding", "gzip");<br />
}<br />
else if (accept.Contains("deflate"))<br />
{<br />
app.Response.Filter = new System.IO.Compression.DeflateStream(stream, System.IO.Compression.CompressionMode.Compress);<br />
app.Response.AppendHeader("Content-Encoding", "deflate");<br />
}<br />
}<br />
}<br />
}<br />
catch (Exception ex)<br />
{<br />
}<br />
}<br />
<br />
private bool CompressScript(string scriptName)<br />
{<br />
if (scriptName.ToLower().Contains(".aspx")) return true;<br />
if (scriptName.ToLower().Contains(".axd")) return false;<br />
if (scriptName.ToLower().Contains(".js")) return true;<br />
return true;<br />
}<br />
<br />
protected void Application_BeginRequest(Object sender, EventArgs e)<br />
{<br />
HttpCompress((HttpApplication)sender);<br />
}<br />
i was testing the above implementation using the above code. I found that my .aspx requests were not gzipped. I checked using the tool Fiddler. it was showing normal 'HttpChunkedEncoding'. i don't know why it was not encoding even though i was wrapping the stream with Gzip Filter.
Strangely, with ajax requests, the gzip compression was working fine.
Can anybody please help me find the solution.
Thanks in advance
Tiju John
|
|
|
|
|
Hi,
I'm using .net 2008.i've a datagrid named 'dgUserNote'. I add edit,cancel,upadte and delete like this;
<asp:editcommandcolumn canceltext="Cancel" edittext="Edit" headertext="Edit" updatetext="Update" xmlns:asp="#unknown">
<asp:buttoncolumn commandname="Delete" headertext="Delete" text="Delete" xmlns:asp="#unknown">
and in coding part i written like;
void dgUserNote_EditCommand(object source, DataGridCommandEventArgs e)
{
dgUserNote.EditItemIndex = e.Item.ItemIndex;
}
but when i click edit first time it will not work; second time only it will work
likewise when i'm clicking cancel button first time it will not work,second time it is going to upadtecommand .
cancel i written like this;
void dgUserNote_CancelCommand(object source, DataGridCommandEventArgs e)
{
dgUserNote.EditItemIndex = -1;
}
and Update i written like this;
SqlCommand SqlCom;
try
{
if (ConGlobal.State == ConnectionState.Closed) ConGlobal.Open();
SqlCom = new SqlCommand("SpInsertUserNote", ConGlobal);
SqlCom.Parameters.Add("@IorU", SqlDbType.VarChar).SqlValue = "U";
SqlCom.Parameters.Add("@Title", SqlDbType.VarChar).SqlValue = e.Item.Cells[2].Text;
SqlCom.Parameters.Add("@Description", SqlDbType.VarChar).SqlValue = e.Item.Cells[3].Text;
SqlCom.Parameters.Add("@Date", SqlDbType.VarChar).SqlValue = e.Item.Cells[4].Text;
SqlCom.Parameters.Add("@UserName", SqlDbType.VarChar).SqlValue = mdlNewClass.gStrUserName;
SqlCom.CommandType = CommandType.StoredProcedure;
SqlCom.ExecuteNonQuery();
SqlCom = null;
Response.Write("Record Updated Successfully...");
BindData();
dgUserNote.EditItemIndex = -1;
}
pls help me in this issue
|
|
|
|