|
Hey cool..will try it rightaway...thanks disgyaza. You have an awesome weekend!!
Swetha
|
|
|
|
|
Stop posting and deleting
Alexei Rodriguez
|
|
|
|
|
I WILL continue to update the code and WILL delete that which is obsolete. The code that was deleted were updated and posted back based on further research and modifications.
Swetha
|
|
|
|
|
swetha sankaran wrote: The code that was deleted were updated and posted back based on further research and modifications.
It looks like you have no idea of what this forum is for
First do "research", then if you dont find the answer, then post, and let the post grow as more people enriches the post
If you continue doing that, i WILL block your account for posting
Alexei Rodriguez
|
|
|
|
|
|
Thats what dubug the application and check which object is null ..
swetha sankaran wrote: String[] instances = (String[])rk.GetValue("InstalledInstances");
Make sure that
rk is not null have if block there and check if (rk != null ) then do that
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
|
|
|
|
|
Does that key exists on your box? on mine with sql2005 it doesnt...
|
|
|
|
|
I think the right path is :
RegistryKey rk = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Microsoft SQL Server");
|
|
|
|
|
Perhaps you need to create a new instance of your RegistryKey.
Try the using key word
using(RegistryKey rk = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft SQL Server"))
{
String[] instances = (String[])rk.GetValue("InstalledInstances");
}
Not entirely sure if that will work for you.
Good luck
Cheers
Disgyza
Programmer Analyst
|
|
|
|
|
|
if have problems getting machine name use:
string name=Environment.GetEnvironmentVariable("computername");
|
|
|
|
|
|
|
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
|
|
|
|