| If statement (3 replies, VIP) |
| ASPFriends.com 'aspngcs' list |
| Hello, I am passing a parameter and then trying to check it's value using some conditional logic to control what actions are taken. Pretty simple stuff. After I set the Param to a variable and then cast that variable to Int32 and check whether it is a 1 or 2, I get a compilation error that says: "Cannont immplicitly convert int to a 'bool'". How does one do simple integer comparisions with if stat... |
|
| Books on ASP.NET (2 replies, VIP) |
| ASPFriends.com 'aspngcs' list |
| Dear friends, someone can suggest me a book that cover in depth ASP.NET with C# Thanks Stefano |
|
| Keep ArrayList Alive (3 replies) |
| ASPFriends.com 'aspngcs' list |
| Can someone tell me the best way to keep an ArrayList current between postbacks? I want to add and remove objects from an arrayList that will exist beyond postbacks. ViewState Session DataSet bound to a web control etc... Does anyone have code that does this? thank you much John |
|
| ArrayList to String ? (5 replies, VIP) |
| ASPFriends.com 'aspngcs' list |
| Can I convert a ArrayList type of object to a string like object. For example, I have an arraylist which has invoice numbers in it. arraylist[0] 0001 arraylist[1] 0002 arraylist[2] 0003 I need convert it into (0001,0002,0003) format So I can use it in my sql statement Select * From INVOICE where ID in (0001,0002,0003) TIA Peter |
|
| DataGrid(s) Problem (8 replies) |
| ASPFriends.com 'aspngcs' list |
| hi, I am trying to have an DataGrid with in a DataGrid, by using the TemplateColumn. I am having the following code: .ASPX Page asp:datagrid id "DataGrid1" style "Z INDEX: 101; LEFT: 45px; POSITION: absolute; TOP: 56px" runat "server" Width "373px" Height "115px" AutoGenerateColumns "False" OnSelectedIndexChanged "ShowChild" Columns asp:ButtonColumn Text "Show Child" HeaderText "Show Child" Comman... |
|
| ArrayList.Add(myObject) (4 replies) |
| ASPFriends.com 'aspngcs' list |
| I was under the impression that I could add an object like so: ArrayList.Add(myObject), but I get the following error when I attempt to add myObject to an ArrayList. System.NullReferenceException: Value null was found where an instance of an object was required. ItemRecord ir new ItemRecord(); ir.SetDescription(description.Text); ir.SetFrequency(frequency.Text); //ADD OBJECT TO ItemList ItemList.A... |
|
| clean up objects (2 replies, VIP) |
| ASPFriends.com 'aspngcs' list |
| Is there a straight forward way of deleting an object? MyObject mo new MyObject(); MyObject.delete(); // something like this thanks |
|
| Applying attributes to a method return value (2 replies) |
| ASPFriends.com 'aspngcs' list |
| Can anyone explain how to apply an attribute to a method return value like you can in VB? I have this method: [WebMethod] [System.Xml.Serialization.XmlInclude(typeof(myCustomClass))] public ArrayList myWebMethod(string s) {} I need to apply an XmlArrayListAttribute to the return value, but can't figure out how to in C#. In VB its this: Public Function GetTheData() As System.Xml.Serialization.XmlAr... |
|
| Event problems with DataGrid (new issue) (7 replies) |
| ASPFriends.com 'aspngcs' list |
| I'm trying to make a DataGrid with an EditCommandColumn to allow the user to edit one field of the column. The problem I'm having is regardless of what button/link the user selected (Edit, Update or Cancel) the "Edit" event is always fired. I have a DataGrid object: protected System.Web.UI.WebControls.DataGrid MyDataGrid; and I set up my Event handlers: MyDataGrid.EditCommand new DataGridCommandEv... |
|
| Add propertyname to class instance (2 replies) |
| ASPFriends.com 'aspngcs' list |
| I have a class called Users and want to do something similar: Users userProfile new Users(); string[] userProfileProperties {"Name","Street","Country"}; foreach (string userProfileProperty in userProfileProperties) { userProfile.userProfileProperty (TextBox)(this.FindControl(userProfileProperty)).Text; // gives error } this means that the Users class has properties that can be accessed with userPr... |
|
| Basic threading question (2 replies, VIP) |
| ASPFriends.com 'aspngcs' list |
| Perhaps someone can help me. I have a form that kicks off a method in a class. The method spawns a thread so that the current thread can return to the form immediately. The spawned thread performs some lengthy task and updates a class variable as to what it's doing. I then have a public method that exposes that variable. The idea is that the form can then show what the lengthy task is doing withou... |
|
| replace chr(10) (3 replies) |
| ASPFriends.com 'aspngcs' list |
| Hello, In my .cs, I tried: Email.Replace(CHR(10)," br"); but i received a error, it didn't recognize the CHR(10). Is this how I keep carriage returns in my database? Please help! Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp |
|
| c# and ADO.net question (5 replies) |
| ASPFriends.com 'aspngcs' list |
| hi, i have created two tables in a datset.. i want to actually put those tables physically in sqlserver2000 database..Anybody knows how to do that. string source "server polaroid bindra;" "uid ;pwd ;" "Integrated Security SSPI;" "database license"; conn new SqlConnection(source); //conn. conn.Open(); //open the connection to sqlserver2000 database license.. rightnow table //is defined in sqlserver... |
|
| COM interop problem (2 replies) |
| ASPFriends.com 'aspngcs' list |
| Greetings, I'm trying to use a COM object in C# that can be used from ASP3.0 as follows: Dim objCollection Dim objMember Set objCollection Server.CreateObject("blah") objCollection.GetCollection For Each objMember in objCollection objMember.Blah Next I've created the .NET wrappers around it and ildasm shows all the methods/properties correctly. It shows objCollection as implementing System.Collect... |
|
| validate calendar control (2 replies) |
| ASPFriends.com 'aspngcs' list |
| Does any one have a straight forward approach to validating a Calendar Control. Does RequiredFieldValidator and CompareValidator have a way to do this? thanks john |
|
| method descriptions (5 replies) |
| ASPFriends.com 'aspngcs' list |
| Copied from [aspngfreeforall] to [aspngcs] by Charles M. Carroll darthcarroll@asplists.com Does anyone know how to do methods descriptions for cs files. Like with webservices you just put: [webmethod (description "This method returns an xml doc")]. Does anyone know the equivalent to this in just a regular cs file? Elvie Get your own "800" number Voicemail, fax, email, and a lot more http://www.ure... |
|
| With Statement (2 replies) |
| ASPFriends.com 'aspngcs' list |
| Is there a C# equilelant to "with" in VB? Dim EnvTCol As New TemplateColumn() With EnvTCol .HeaderText "Description" .ItemTemplate New DynamicItemTemplate() .EditItemTemplate New DynamicEditItemTemplate() End With Thanks, Scott |
|
| <asp:hyperlink (2 replies) |
| ASPFriends.com 'aspngcs' list |
| Hello, In my user control, I have a asp:hyperlink id "home" runat "Server" /hyperlink tag. In my codebehind, I have: protected System.Web.UI.WebControls.HyperLink home; In page load home.NavigateUrl "http://www.sadfsdfa.com"; I get a error: Exception Details: System.NullReferenceException: Value null was found where an instance of an object was required. Confused? Get your FREE download of MSN Exp... |
|
| datalist - itemdatabound problem (4 replies) |
| ASPFriends.com 'aspngcs' list |
| Hi, I have this problem: I have a datalist on my webform and a data binded to it. This works fine. But when i want to change the look of some items with the ItemDataBound method it doesn't work the way it's written in help. I have it like this: private void dlSomeList ItemDataBound(object sender, DataListItemEventArgs e) { int intOK 3D (int)(e.Item.DataItem["columnname"]); if (intOK 3D 3D 1) { e.I... |
|
| C# Coding (4 replies) |
| ASPFriends.com 'aspngcs' list |
| I have this code in VBScript URL Request.ServerVariables("SCRIPT NAME") NewUrl Right(URL,5) How can I do the same in C#? I am trying to convert my vbscript code to c# code is there anywhere That I an compare the c# language equivalents to the vb language? Thanks, Dean |
|
| SV: C# Coding (2 replies) |
| ASPFriends.com 'aspngcs' list |
| Hi! Don't know if there is a equivalent to the "Right" function in VBScript so I guess you have to do like this: String URL 3D Request.ServerVariables["SCRIPT NAME"]; String NewUrl 3D URL.Substring(URL.Length 5, 5); /Johan Ursprungligt meddelande Fr E5n: Dean Santillan [mailto:dean@5dayweek.com] 20 Skickat: den 21 november 2001 08:09 Till: aspngcs C4mne: [aspngcs] C# Coding I have this code in VBS... |
|
| in-line parameters with a stored procedure and output parameters? (2 replies, VIP) |
| ASPFriends.com 'aspngcs' list |
| Moved from [aspngarchitecture] to [aspngcs] by Charles M. Carroll darthcarroll@asplists.com I am envisioning different solutions to avoid the grueling code needed to add all parameters explicitly. So far, I have discovered that it is possible to create parameters implicitly by just passing them inline, e.g.: string strConn 3D ConfigurationSettings.AppSettings["TDSconnectionString"]; 20 //create th... |
|
| 1. DataSet and Deleting Rows (2 replies) |
| ASPFriends.com 'aspngcs' list |
| Ok, I'm missing something here. ( A couple of things actually, I'll send seperate emails) I'm trying to delete rows from a dataset and then have them reflected back into the table the dataset is sourced from. All the available documentation on this revolves around using a SqlDataAdapter with a SelectCommand and then using a SqlCommandBuilder to automatically create the delete statement. This is fi... |
|
| Looking for a C# fundamental refenance book (3 replies, VIP) |
| ASPFriends.com 'aspngcs' list |
| what would you recommend as a C# fundamental reference book Dennis H. West West Design dotnetDeveloper http://www.aspalliance.com/dotnetsolutions westdh@home.com |
|
| Need some help in converting VBscript to C# (3 replies, VIP) |
| ASPFriends.com 'aspngcs' list |
| I have some asp vbscript code for building an Access query:. I am trying to convert it to C# SqlServer/2000 can anyone help convert this thing .I have made an attempt but there are some obvious things that have not been converted correctly or not at all. (I have included the vb script) the database fields I am searching on are Problem and Solution. this is my attempt at converting it to C# I have ... |
|