|
Pete O'Hanlon wrote: hellborn son of Stan
Can I assume the misspelling is intentional?
|
|
|
|
|
Brady Kelly wrote: SqlDataSource
That stuff is nasty, I never use it
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I actually like it, this is the first time I've been bitten.
|
|
|
|
|
Hi all,
I am creating my database using the server explorer in VS 2005, I defined almost all tabes and relations I need except that I don't know how to impose a 'unique' constraint on a specific column called "username".
Any idea on how to do this using Server explorer?
Thanks
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
This isn't the right forum for SQL questions. You should use the SQL forum in future.
Open your table in design mode. From the 'Table Designer' menu, select Indexes/Keys. Create a new index and set its 'Is Unique' property to True.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanks for the answer.. Done!
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
hello all,
i need to know if i can call the web form as if it is a class that i can inherite or take an object of it
thanks in advance
abdelhameed81
|
|
|
|
|
abdelhameed81 wrote: i need to know if i can call the web form as if it is a class that i can inherite or take an object of it
You could have a number of of web forms that inherit from the same code-behind class.
I can't imagine why you would want to create an instance of a web form code-behind class on its own though. Maybe you can further clarify what you want to achieve.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
thanks for replying. The idea is that i need to access a control inside that form to make some modifications in that user control instead of creating many user controls with some minor changes.
I hope that i made the idea clearer. Thanks
|
|
|
|
|
This sounds like a horrible idea. I would strongly discourage it.
What kind of minor changes are you talking about? If they are cosmetic changes, you could consider writing a templated user control where the presentation can be modified for each instance.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
mmmm
this sounds like a good idea, thanks for your support
|
|
|
|
|
Your web form is a class already. You can inherit from it, create an instance of it (making an object of it) and so on.
But, why would you want to create one outside of the context that ASP.NET creates it for you in the first place?
|
|
|
|
|
thanks
please refer to my reply on pmarfleet
Br,
|
|
|
|
|
Hi All,
I want to add a User Control at runtime. Like the user control should be added when a particular button on the another user control is clicked. And if not clicked it shouldnt be displayed.
And maintain the view state of the controls which are inside the User Control. Can anybody please help me in this.
Thanks,
Aleem Mohammad.
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
In order to dynamically add a user control (or any control for that matter) to the page you need to add it to an appropriate controls collection. Each control has a controls collection as does the page.
So, create your user control then add it to the controls collection you want (probably the page, or possibly the controls collection of the other user control)
Remember dyanmically created controls will not be recreated at each postback. It is your responsibility to recreate the control on each post back. So long as you create the control during the page load event then you will get the viewstate along with it. (Although, maybe not in during the Page Load event itself).
|
|
|
|
|
Hi,
i have uploaded my site to web server goddady.com
i have a button to download dyanmically generated excel file.This button is ajax enabled.....When i am click on this button it will popup a message like
"That assembly does not allow partially trusted callers"
This is my web.config file
Code: ( xml )
1. <?xml version="1.0"?>
2.
3. <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
4.
5. <configSections>
6. <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectio nGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
7. <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
8. <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHa ndlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
9. <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSecti onGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
10. <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializatio nSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
11. <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSe ction, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
12. <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationSe rviceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
13. </sectionGroup>
14. </sectionGroup>
15. </sectionGroup>
16. </configSections>
17.
18. <appSettings>
19.
20. </appSettings>
21. <connectionStrings/>
22. <system.web>
23.
24. <compilation debug="false">
25. <assemblies>
26. <add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
27. <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
28. <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
29. <add assembly="System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
30. <add assembly="System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
31. <add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
32. <add assembly="Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"/>
33. <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
34. </assemblies>
35. <buildProviders>
36. <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
37. </buildProviders>
38. </compilation>
39.
40. <authentication mode="Windows"/>
41.
42. <pages styleSheetTheme="Smoke">
43. <controls>
44. <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
45. </controls>
46. </pages>
47.
48. <customErrors mode="Off" defaultRedirect="Error.aspx">
49. </customErrors>
50.
51. <httpHandlers>
52. <remove verb="*" path="*.asmx"/>
53. <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
54. <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
55. <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
56. </httpHandlers>
57. <httpModules>
58. <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
59. </httpModules>
60. <identity impersonate="true" />
61.
62. </system.web>
63.
64. <system.web.extensions>
65. <scripting>
66. <webServices>
67.
68. </webServices>
69.
70. </scripting>
71. </system.web.extensions>
72. <system.webServer>
73. <validation validateIntegratedModeConfiguration="false"/>
74. <modules>
75. <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
76. </modules>
77. <handlers>
78. <remove name="WebServiceHandlerFactory-Integrated"/>
79. <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
80. <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
81. <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
82. </handlers>
83. </system.webServer>
84.
85. </configuration>
This code below is for generating Excel
//launch an excel instance
Excel.Application excel = new Excel.ApplicationClass();
//set the visibility to true
excel.Visible = false;
//Add a workbook object
Excel.Workbook workbook = excel.Workbooks.Add(Server.MapPath("~\\General\\Invoice\\Invoice.xlt"));
//Create a worksheet object
Excel.Sheets sheets = workbook.Worksheets;
//from the collection of worksheet select one worksheet
Excel.Worksheet mySheet = (Excel.Worksheet)sheets.get_Item("Invoice");
//select the cell in the worksheet
Excel.Range name = (Excel.Range)mySheet.get_Range("B8", "B8");
Excel.Range school = (Excel.Range)mySheet.get_Range("B9", "B9");
Excel.Range street = (Excel.Range)mySheet.get_Range("B10", "B10");
Excel.Range city = (Excel.Range)mySheet.get_Range("B11", "B11");
Excel.Range tel = (Excel.Range)mySheet.get_Range("B12", "B12");
Excel.Range date = (Excel.Range)mySheet.get_Range("F3", "F3");
Excel.Range invoiceNo = (Excel.Range)mySheet.get_Range("F4", "F4");
Excel.Range dueDate = (Excel.Range)mySheet.get_Range("F15", "F15");
//assign text value to string
string contact = lblName.Text;
string schoolName = lblSchName.Text;
string address = lblStreet.Text;
string state = lblCity.Text;
string telephone = lblTel.Text;
string currentDate = lblDate.Text;
string invoiceNumber = lblInvoiceNo.Text;
string dateDue = lblDueDate.Text;
//Add a text in the cell
name.Value2 = contact;
school.Value2 = schoolName;
street.Value2 = address;
city.Value2 = state;
tel.Value2 = telephone;
date.Value2 = currentDate;
invoiceNo.Value2 = invoiceNumber;
dueDate.Value2 = dateDue;
string url = Server.MapPath("~\\General\\DownloadInvoice\\Invoice.xls");
try {
FileInfo TheFile = new FileInfo(url);
if (TheFile.Exists)
{
File.Delete(url);
workbook.SaveAs(url, Excel.XlFileFormat.xlWorkbookNormal, null, null, false, false, Excel.XlSaveAsAccessMode.xlShared, false, false, null, null, null);
workbook.Close(false, null, null);
}
else
{
workbook.SaveAs(url, Excel.XlFileFormat.xlWorkbookNormal, null, null, false, false, Excel.XlSaveAsAccessMode.xlShared, false, false, null, null, null);
workbook.Close(false, null, null);
}
}
catch (FileNotFoundException ex) { }
Please help me on this issue?
|
|
|
|
|
Hi All!
Im have a problem of using crystal report with web page.currently im using crystalViewer in different page (that is in different folder,and also view the report as another new web page not the same one), and my main form is in the fifferent folder, i have code databinding and parameter setting also in that crystalviewer page,that is not working properly some of mistakes are there,if someone know any better idea with this pls help me to solve this.
|
|
|
|
|
How can I customize the layout of my divs during runtime? I need to Know how to change the location of the divs in the site if it is possible. Thanks
|
|
|
|
|
Do you mean dragging the div's ? Use javascript to do that. There is a project in codeplex named "DropThings". Look at it's code.
|
|
|
|
|
10xs for your reply. My real problem is to create a GUI where a user can change the location of the divs from a webpage that allows to do so. if you know how please post again.
|
|
|
|
|
Hi,
I wrote this code for sending mail but the error that the ip is refused is appeared,
what's the problem?
Dim message As New MailMessage()
Dim f1 As String = String.Empty
If FileUpload1.HasFile Then
f1 = FileUpload1.FileName
FileUpload1.SaveAs(Server.MapPath("Attach/" + file1))
Dim attach As New Attachment(Server.MapPath("Attach/" + file1))
message.Attachments.Add(attach)
End If
message.Body = txtBody.Text
Dim mailAdrs As New MailAddress(txtEmailSender.Text, txtSender.Text)
message.From = mailAdrs
message.Subject = txtSubject.Text
Dim con As New SqlConnection()
con.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("DrMasanConnectionString").ConnectionString
Dim com As New SqlCommand()
com.CommandText = "Select Email From [User]"
com.Connection = con
con.Open()
Dim reader As SqlDataReader = com.ExecuteReader()
While reader.Read()
message.To.Add(reader("Email"))
End While
Dim smtpC As New SmtpClient()
smtpC.Host = "drmasan.com"
smtpC.Send(message)
Best wishes
|
|
|
|
|
mehrdadc48 wrote: smtpC.Host = "drmasan.com"
Looks like the host name provided here is refusing connection. Have checked with the provider ?
mehrdadc48 wrote: While reader.Read()
message.To.Add(reader("Email"))
End While
mehrdadc48 wrote: FileUpload1.SaveAs(Server.MapPath("Attach/" + file1))
Dim attach As New Attachment(Server.MapPath("Attach/" + file1))
OT : AFAIK, there is a limit in the number of recipients which can be specified at the TO address. So if you have more number of users than the allowed limit, it will throw error. Also there is no need to save the file for attaching with mail, you can attach a file from stream.
|
|
|
|
|
Hi,
I have an httpmodule which am using to modify the value of my querystring parameter.
What i did was to encrypt the value of the querystring parameter, am decrypting the parameter inside the BeginRequest event so my code behinde will have access to the plaintext.
the issue is when retrieve the parameter into a NameValueCollection and try to use the Set method to update the parameter value i get this error. System.NotSupportedException: Collection is read-only.
but i can't access the IsReadOnly property of the class. how do i update the decrypted parameter value to the querystring so i can have the plaintext in my code behind.
Thanks in advance
Lookman
|
|
|
|
|
AFAIK, query string collection is read only. So you can't assign anything to there. Instead ,you can rewrite the path with the new values required. Use Context.RewritePath
|
|
|
|
|
wat happens to the NameValueeCollection Set Method, wat is d use?
|
|
|
|
|