Oxiegen 88 Basically an Occasional Poster Featured Poster

In what context?
Is this a Windows application?
What have you tried so far?

A datagrid in a windows form can for example be bound to a DataSet or a DataView.
Here are some examples for you to try:
http://forums.asp.net/t/1524693.aspx
http://msdn.microsoft.com/en-us/library/aa984294(VS.71).aspx

All you have to do is put the code together in the button-click event.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Add a field in the MS Access database table called "Deleted" or something like it with a datatype of Boolean.
And then add a WHERE-clause in the database query to populate the listbox. SELECT * FROM <table> WHERE Deleted = 0

Oxiegen 88 Basically an Occasional Poster Featured Poster

In Visual Studio 20005/2008 you can add a new connection through a wizard.
At one point the wizard tells you that you've selected a local data file that's not in the current project, and asks if you would like to copy the database file to your project folder.

Choosing NO will keep the database file at the current location and your VB project will use and share that file.

Oxiegen 88 Basically an Occasional Poster Featured Poster

What were you planning to put in your textboxes?

As you said, the method ConversionRate takes two numeric arguments representing each country.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Doesn't this all depends on how you place your monitors?
One monitor is always the primary depending on which graphics port you use on your computer.

In either case, perhaps you should take a look at the Screen class?
More specifically the property AllScreens which contains a collection of all screens.

You can check for the Primary screen with this:

If Screen.AllScreens(0).Primary Then
     '' Code for displaying box on the seconday screen
     '' using Screen.AllScreens(1).Bounds or .WorkingArea
Else
     '' Code for displaying box on the primary screen
     '' using Screen.AllScreens(0).Bounds or .WorkingArea
End If
Oxiegen 88 Basically an Occasional Poster Featured Poster

You're welcome.
It's great that you managed to solve the problem.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Ok. Here's another thought.
Can you see all controls in the template while in design mode?
If so, what happens if you double-click the dropdown control?

You should be "transferred" to the codebehind-file and a method is created for the dropdown-control's SelectedIndexChanged event.
And thus recognized.

On the other hand, have you checked to see if the dropdown gets declared while inside the template?
If it's not. Just manually declare it yourself in the codebehind-file. Protected WithEvents CriticalBx As DropDownList

Oxiegen 88 Basically an Occasional Poster Featured Poster

Quite right.
You can also change the format of the date in the gridview.
But if you change the format of the date at the source, you only have to do it once and makes for, in my opinion, cleaner code.

Oxiegen 88 Basically an Occasional Poster Featured Poster

you need to do coding in cs file, you cannot add if statement in aspx page, .

Not to complicate anything or something. But this is not entirely accurate.
You don't need to use CS or VB codebehind file.

You can use <script runat="server"></script> directly in the <head> section of the ASPX file, like in ASP. But that's another story and is quite messy.

<script runat="server">
Protected Sub SomeControl_SomeEvent(sender as Object, e As EventArgs) Handles SomeControl.SomeEvent
      If dropdownlistbox1.selectedindex = 1 Then
            'whatever u want
      Else
           'something else
       End If
End Sub
</script>
<script runat="server">
protected void SomeControl_SomeEvent(Object sender, EventArgs e)
{
      if (dropdownlistbox1.selectedindex = 1)
     {
            //whatever u want
      } else {
           //something else
       }
}
</script>
Oxiegen 88 Basically an Occasional Poster Featured Poster

This is a quick and dirty way of doing it. I sometimes use it as a last resort.

Iterate through the Control collection of the page checking each controls ClientID.
If it matches the ID you gave the control, then you have a reference you can use.

Private classVariable_Control As Object = Nothing
Private Sub LookForControl(parent As Control)
	For Each ctl As Control In parent.Controls
		If TypeOf ctl Is DropDownList Then
			If ctl.ClientID.Equals("CriticalBx") Then
				classVariable_Control = ctl
				'Exit the Sub and do something with the object
			End If
		End If
		If ctl.HasControls Then LookForControl(ctl)
	Next
End Sub

But it just occurred to me.
Did you try the SelectedIndexChanged event?

Protected Sub CriticalBx_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles CriticalBx.SelectedIndexChanged
		'Some event coding
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

You might wanna have a look at the ClientID property.
ASP.NET adds the container ID to the ID of a control in the container but ClientID is always the ID you gave the control.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Try this (add the red part):

<asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="#CC9966"
            BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="SqlDataSource1"
            Style="z-index: 103; left: 288px; position: absolute; top: 256px" AutoGenerateColumns="False">
            <RowStyle BackColor="White" ForeColor="#330099" />
            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
            <Columns>
                <asp:BoundField DataField="Expr1" HeaderText="Expr1" ReadOnly="True" SortExpression="Expr1" DataFormatString="{0:d}" HtmlEncode=False />
                <asp:BoundField DataField="Expr2" HeaderText="Expr2" SortExpression="Expr2" DataFormatString="{0:d}" HtmlEncode=False />
                <asp:BoundField DataField="DAYS" HeaderText="DAYS" ReadOnly="True" SortExpression="DAYS" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:guest1 %>"
            SelectCommand="SELECT CONVERT (DateTime, date_of_arr, 103) AS Expr1, CONVERT (DateTime, date_of_dept, 103) AS Expr2, DATEDIFF(dd, date_of_arr, date_of_dept) AS DAYS FROM guesthouse WHERE (CONVERT (DateTime, date_of_arr, 103) = @date_of_arr)">
            <SelectParameters>
                <asp:ControlParameter ControlID="arrivaldate" Name="date_of_arr" PropertyName="Text" />
            </SelectParameters>
        </asp:SqlDataSource>
Oxiegen 88 Basically an Occasional Poster Featured Poster

Have you tried creating a Webservice as an intermediate between your site and the dB-server?
Perhaps that will eliminate the problem.

Oxiegen 88 Basically an Occasional Poster Featured Poster

I can't see why it would'nt work.
Compare with one of my methods for clearing all labels.

private void ClearAll(Control parent)
{
    foreach (Control ctl in parent.Controls) {
        if (ctl is Label) {
            if (((Label)ctl).Text == "a") ((Label)ctl).Text = ""; 
        }
        if (ctl.HasControls) ClearAll(ctl); 
    }
}

However, have you considered that your checkboxes may not have been completely rendered before you call the checkAllHTML method?
If you create the checkboxes on the Page_Load event, and then call the checkAllHTML on a postback, they may no longer exist.
I noticed that you haven't enabled ViewState for your checkboxes.
You could try if that helps.

Oxiegen 88 Basically an Occasional Poster Featured Poster

<bump>

sknake commented: bump -1
Oxiegen 88 Basically an Occasional Poster Featured Poster

Change this

SelectCommand="SELECT date_of_arr, date_of_dept, DATEDIFF(dd, date_of_arr, date_of_dept) AS DAYS FROM guesthouse WHERE (date_of_arr = @date_of_arr)">

Into this

SelectCommand="SELECT CONVERT(DateTime,date_of_arr,103), CONVERT(DateTime,date_of_dept,103), DATEDIFF(dd, date_of_arr, date_of_dept) AS DAYS FROM guesthouse WHERE (CONVERT(DateTime,date_of_arr,103) = @date_of_arr)">

Notice the CONVERT functions.
The CONVERT function takes 2-3 arguments.
1: The target datatype of the field
2: The fieldname
3: The format of the output

Here's an overview of how to format dates in SQL: http://msdn.microsoft.com/en-us/library/aa226054(SQL.80).aspx

Oxiegen 88 Basically an Occasional Poster Featured Poster
Oxiegen 88 Basically an Occasional Poster Featured Poster

The easiast way to do this would be to first fetch the information from the database then call a seconday method in order to update the database.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim connstr As String
connstr = ConfigurationManager.ConnectionStrings("guest1").ConnectionString()
Dim SQL As String = "select booking_no from guesthouse"
Dim conn As New SqlConnection(connstr)
conn.Open()
Dim com As New SqlCommand(SQL,conn)
Dim dr As SqlDataReader

dr = com.ExecuteReader()
If dr.HasRows Then
   dr.Read()
   sino.Text = dr(0).ToString
End If
conn.Close()

UpdateBookingNo()
End Sub

Private Sub UpdateBookingNo()
Dim connstr As String
connstr = ConfigurationManager.ConnectionStrings("guest1").ConnectionString()
Dim SQL As String = "update guesthouse set booking_no = booking_no + 1"
Dim conn As New SqlConnection(connstr)
conn.Open()
Dim com As New SqlCommand(SQL,conn)
com.ExecuteNonQuery()
conn.Close()
End Function
Oxiegen 88 Basically an Occasional Poster Featured Poster

My first question is, will I need any form of source code? i.e. do you need you compile .NET code before you can deploy an application?

Yes and no, you do need the sourcecode for recompilation. And also in order to fix the second question.
However, you don't need the sourcecode if you know that everything will work precompiled out-of-the-box.

My question is, how do I find out where the IsPostCard() function is declared. As the gallery is working fine despite this error, I was hoping to amend the script and remove the reference to the key so the error doesn't appear.

I need to find out what file the IsPostCard() function is in and also what file the postcard namespace is defined.

See first answer.
Look for any references for the saught method in the codebehind file of the page where the error occurs.
If, at first glance, you cannot find the method. Load the project in debug mode from Visual Studio, or whatever development tool you're using, and set a breakpoint either on the Page_Load event or somewhere before you think the IsPostCard() method is called.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Perhaps if you change this e.Day.Date into this e.Day.Date.ToString("dd/MM/yyyy")
Otherwise you may have to complicate things by going into localization, but then your in the hands of the visitor and their local computersettings.

Oxiegen 88 Basically an Occasional Poster Featured Poster

If you have a database table with predefined usernames and passwords, then all you have to do is add a numeric field called "isonline" or something.

When the user logs on you set that field to 1 and when the user leaves your site you simply set it to 0. (Yes, it's possible).

If the field is set to 1 then all you have to do is iterate through the table to find the usernames of all that has the field "isonline" = 1.

Oxiegen 88 Basically an Occasional Poster Featured Poster

The easiast way to increment a number by 1 is to do it directly in the SQL-query.

For example: UPDATE table1 SET serialnumber = serialnumber + 1 WHERE id = <id>

Oxiegen 88 Basically an Occasional Poster Featured Poster

Most likely you have to create an ActiveX control that visitors have to install.
Because a webcam is a clientside device you cannot control it from a serverside-codebehind.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Here's a method to upload files using FTP in ASP.NET.
http://www.devasp.net/net/articles/display/280.html

Oxiegen 88 Basically an Occasional Poster Featured Poster

You can use the RequiredFieldValidator-control.
Put one next to each textbox or dropdownlist and bind each validator-control to the corresponding input-control.

Oxiegen 88 Basically an Occasional Poster Featured Poster

What is the error you recieve?

Perhaps you should implement some error checking like a try...catch.
Also, the use of CDate(...) always gives me a chill.
You should always make sure that the string passed into that method is a valid date.

Try this instead.

Dim dateString As String
Dim test As DateTime
If DateTime.TryParse(dateTextBox.Text,test) Then
     dateString = test.ToShortDateString()
End If
Oxiegen 88 Basically an Occasional Poster Featured Poster

With MS Access you can create links to tables in another MS Access database, and then create an update query that updates the local tables with information from the linked tables.
Then assign that query to a button.

I believe you can also enforce a readonly restriction on those links.

Oxiegen 88 Basically an Occasional Poster Featured Poster

In order to create a PDF from ASP.NET (C#,VB...) you need a third-party tool.
I recommend using ITextSharp, because it's very easy to use and it's free. http://sourceforge.net/projects/itextsharp/
ITextSharp has methods that basically does exactly what you are looking for.

Here's an example of how to do it:
http://www.atashbahar.com/post/Converting-Multipage-TIFF-image-to-PDF.aspx
Note that this example uses a TIFF image file, but you can probably use any image-object.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Hi
I want pass multiple values javascript to asp.net(C#) server side...
how i do it using array ??
don't using hidden fields...

thanks

I'm not exactly sure what you are trying to do.
But I would compile the information into an XML or JSON-string and pass that back to a [WebMethod] in the codebehind using Ajax.

If you are not developing in ASP.NET 3.5 then AjaxPro is an excellent Ajax toolkit.

Oxiegen 88 Basically an Occasional Poster Featured Poster

I'm not entirely sure if this thread belongs here, or in "JavaScript / DHTML / AJAX".
Anyway. I have a bit of a problem here, hoping that a kind soul might be able to help.

On one of the webpages for the site I'm developing I have a bunch of ASP.Net Ajax action going on, and also some jQuery action.

Here the problem:
If I first click on the link leading to the contact-form, which is shown in a jQuery/CSS popup, then close the popup and then select an item in a ListBox with AutoPostBack enabled.
I recieve the javascript error "Sys.ArgumentTypeException: Object of type 'Sys._Application' cannot be converted to type 'Sys._Application'. Parametername: instance."

If I choose to not debug, the brower loads the full page of the contact-form instead of executing the codebehind-method for the listbox.

Now, I've been google'ing for this error message. But the closest thing I get is that this error is releted to SmartNavigation.
However, that method is depricated, and basically not existing, in .NET 3.5.

Oxiegen 88 Basically an Occasional Poster Featured Poster

I figured it out with the help from this guide:
No major customization needed.

http://en.csharp-online.net/TabControl#Render_Right-Aligned_or_Left-Aligned_Tabs_horizontally

Oxiegen 88 Basically an Occasional Poster Featured Poster

I believe it can be done, I just don't know how.
I do know that it requires some major customazation.

So I was wondering if anyone could provide with some intel or links as to where one might find such a control without, or prefereble with, sourcecode.

I've done some major google'ing, but most of my hits turn out to be nothing of what I'm looking for.

Oxiegen 88 Basically an Occasional Poster Featured Poster

I know how to use the TabControl as it is. I've used it many times.
And I know that you can align the actual tabs in any orientation, Top/Left/Bottom/Right.

However, when aligning them either Left or Right, the tabs are displayed vertically.
I would like to have them displayed horizotally, as if they would be when aligned Top or Bottom. But lined up vertically.

(tabs) (tab page)
________|¤¤¤¤¤¤¤¤¤¤¤¤|
________|¤¤¤¤¤¤¤¤¤¤¤¤|
________|¤¤¤¤¤¤¤¤¤¤¤¤|
________|¤¤¤¤¤¤¤¤¤¤¤¤|

(I suck at ascii graphics)

Is this possible?

Oxiegen 88 Basically an Occasional Poster Featured Poster

First off, you don't need to use the statement With Me because it's redundant.

Second, in an If statement there's only need for (in my oppinion) one Else.
As the If statement is for checking different values you should use: IF {something} Else If {something else} Else {totally different} End If This is what I would do (I agree about the last If statement being wrong):

If makeoverRadioButton.Checked Then
	MakeoverLabel.Text = MAKEOVER_Decimal.ToString()
Else If HairStylingRadioButton.Checked Then
	hairStylingLabel.Text = HAIR_STYLING_Decimal.ToString()
Else If manicureRadioButton.Checked Then
	manicureLabel.Text = MANICURE_Decimal.ToString()
Else 
	permanentMakeupLabel.Text = PERMANENT_MAKEUP_Decimal.ToString()
End If

Or

If makeoverRadioButton.Checked Then
	MakeoverLabel.Text = MAKEOVER_Decimal.ToString()
End IF
If HairStylingRadioButton.Checked Then
	hairStylingLabel.Text = HAIR_STYLING_Decimal.ToString()
End IF
If manicureRadioButton.Checked Then
	manicureLabel.Text = MANICURE_Decimal.ToString()
End IF
If permanentMakeupRadioButton.Checked = True Then
	permanentMakeupLabel.Text = PERMANENT_MAKEUP_Decimal.ToString()
End If

Good luck!

Oxiegen 88 Basically an Occasional Poster Featured Poster

Hi, it's me agin.

I would like to know if it's possible to customize a tabcontrol, so that I can have the tabpages shown horizontally when alignment is set to left or right.

If so, could someone give an example, or a link, of how to accomplish this?

I've been working with overriding OnDrawItem, but all I manage to do is make a complete mess.

Thanks!

Oxiegen 88 Basically an Occasional Poster Featured Poster

I would try to limit the amount of data for each query.
Using the reader in order to populate some kind of repository do take a long time.
The way the reader works is that it only reads one line of data at a time.
Ie:

While Rs.Read
If Not IsDBNull(Rs.Item("some_column_name")) Then repository = Rs.Item("some_column_name")
End While

However, if you limit the amount of data to read with a WHERE clause this will go faster.

Or, you could use a dataadapter/dataset and basically get a mirror copy of the data.
Then you can search and select from there.

Public db_name As String
Public db_username As String
Public db_userpassword As String
Public db_server As String

Public connStr As String
Public sqlCommand As OdbcCommand
Public sqlConn As OdbcConnection
Public Rs As OdbcDataReader  '''Remove this
Public Da as OdbcDataAdapter '''Replace with this
Public sqlComBuilder as OdbcCommandBuilder '''Add this
Public Ds As DataSet '''Add this too

Public Sub DoQuery(ByVal tmpSQL as String)
    connStr = "Driver={PostgreSQL ANSI};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword

              sqlConn = New OdbcConnection(connStr)
              Da = New OdbcDataAdapter(tmpSQL, sqlConn)
              sqlComBuilder = New OdbcCommandBuilder(Da)
              Ds = New DataSet()

              sqlConn.Open()
              Da.Fill(Ds,"name_of_table")
              sqlConn.Close()
End Sub

The CommandBuilder is used to automatically create INSERT/DELETE/UPDATE queries when you need to update, insert or delete information in the database. Good thing to use if you don't want to create long and complicated queries manually.

Oxiegen 88 Basically an Occasional Poster Featured Poster

The code looks valid and it's gonna do what it's supposed to.
You don't need a Do While.

This snippet extracts the first and last character of the string which is then used in the IF statement for comparison. str1stCharacter = Microsoft.VisualBasic.Left(strInput, 1) strlstCharacter = Microsoft.VisualBasic.Left(strInput, 4) What, exactly, is it that you want to do and you get stuck on?

Oxiegen 88 Basically an Occasional Poster Featured Poster

Thanks!
It works perfectly!!

This problem has now been solved...

Oxiegen 88 Basically an Occasional Poster Featured Poster

I tried your solution bwKeller. It works! Thanks a bunch!! :-D

The next part is tricky, because within a nested For loop I need to set 3 colors for each pixel.

For y As Integer = 0 To glyph.Height - 1
     For x As Integer = 0 To glyph.Width - 1
          If transColor.R = pDest(nPixel + 2) AndAlso transColor.G = pDest(nPixel + 1) AndAlso transColor.B = pDest(nPixel) Then
               pDest(nPixel) = backColor.B
               pDest(nPixel + 1) = backColor.G
               pDest(nPixel + 2) = backColor.R
          End If
          nPixel += 3
     Next
     nPixel += nOffset
Next

However, the byte array only becomes 1083 (give or take a few) in size and pDest(nPixel + 1) is larger than that, I get an Index out of bounds error.

I'm guessing the array needs to be increased in size by a factor of nOffset so I'm just gonna test that and see what happens.
The array will probably be larger then needed. Would that screw up the bitmap?

Oxiegen 88 Basically an Occasional Poster Featured Poster

I'm wondering if you have tried this yourself? And it works?
For me, it doesn't work in VB = I've tried before posting.
This gives the error: End of statement expected. Dim pDest As Byte* = CByte(CType(scan0, void*)) The * indicates that this is a pointer and only works in C++/C#.
These types of declarations are not possible In VB.

I actually put the entire sub through an online conversiontool and that resultet in the very same code you posted.

Currently I'm working with Marshal and a byte array to see if I can get it to work.

Dim pDest As IntPtr = Marshal.AllocHGlobal(Marshal.SizeOf(scan0))
 pDest = CByte(CType(scan0, Byte))

Suggestions and ideas are welcome.

Thanks!

Oxiegen 88 Basically an Occasional Poster Featured Poster

Hi!

It's been a while since i last posted, and now I'm in need of some expert assistance.

I've found this Control written in C# with .NET 1.0 on vbAccelerator and wanted to use it with my current project. I decided to convert the entire code to VB.NET but one of the subs contains "pointer code".

I know you can use combinations of IntPtr, Marshal and GCHandle to emulate(?) pointer handling, but I don't know how.
I would very much appreciate some help with converting this portion of the code.
More specifically those lines that contain "pointer code" (marked with red).

BitmapData bmData = glyph.LockBits(
            new Rectangle(0, 0, glyph.Width, glyph.Height),
            ImageLockMode.ReadWrite,
            PixelFormat.Format24bppRgb);
         IntPtr scan0 = bmData.Scan0;
         int nOffset = bmData.Stride - glyph.Width * 3;

         unsafe
         {
            byte * pDest = (byte *)(void *)scan0;

            for (int y = 0; y < glyph.Height; ++y)
            {
               for (int x = 0; x < glyph.Width; ++x)
               {
                  // Check whether transparent:
                  if (transColor.R == pDest[2] && 
                     transColor.G == pDest[1] &&
                     transColor.B == pDest[0])
                  {
                     // set to background colour
                     pDest[2] = backColor.R;
                     pDest[1] = backColor.G;
                     pDest[0] = backColor.B;
                  }
                  else
                  {
                     // Get HLS of existing colour:
                     Color pixel = Color.FromArgb(pDest[2], pDest[1], pDest[0]);
                     float lumPixel = pixel.GetBrightness();
                     if (lumPixel <= 0.9F)
                     {
                        float lumOffset = lumPixel / transLuminance;
                        lumPixel = backLuminance * lumOffset;
                        if (lumPixel > 1.0F)
                        {
                           lumPixel = 1.0F;
                        }
                     
                     }
                     // Calculate the new colour
                     HLSRGB newPixel = new HLSRGB(backHue, lumPixel,
                      backSaturation);

                     // set the …
Oxiegen 88 Basically an Occasional Poster Featured Poster

Hi, all!

I'm trying to send a HttpWebRequest to an url that, other than %20, does not take escaped characters.
But for some reason, when I do: _HttpWebRequest = DirectCast(System.Net.HttpWebRequest.Create(New Uri("http://web_address")), System.Net.HttpWebRequest) I end up with an escaped uri string.
For example, a string containing the swedish letters å, ä and ö always become escaped.
I need to prevent that from happening.

Anyone knows how to do this, so that I can send a clean uri string?

Thanks!

Oxiegen 88 Basically an Occasional Poster Featured Poster

Problem solved.
Instead of using a JSON string I used a DataTable.
Appearantly AjaxPro supports using .NET objects as arguments and converts them into appropriate javascript objects.

Thank you very much for all your assistance.
Couldn't have done it without you.

Thank you, thank you, thank you!!!

Oxiegen 88 Basically an Occasional Poster Featured Poster

Nevermind.
I solved the problem using a DataTable to send the information back and forth between client and server.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Hi.

As suggested by ~s.o.s~ in another thread, I'm posting this question here in the high hopes that someone might be able to help me.

I have a JSON string coming in from a javascript that I need to convert to a predefined class object. I'd even settle for a struct.

The string in question may, or may not, contain an array of "objects". So that needs to be taken into consideration.

I've tried getting this to work with several methods by using different JSON libraries.
Two of the libraries are AjaxPro (which includes a JSON parser/serializer/deserialiser) and JayRock.

With JayRock I managed to import the JSON string into a variable of the datatype Object.
But I haven't worked much with that datatype so I'm having some trouble getting access to the data inside it.
During debugging I can see that it contains a JSONObject which in turn contains an ArrayList.

How do I convert this "object" into a workable .NET object so that I can access the data using properties?

I surely hope that anyone can understand my ranting and help/guide me with this problem.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Perhaps that is the case.
But on the other hand. The fact that this forum also is about Ajax may be of relevance since that, for me, includes both client-side and server-side coding.

Oxiegen 88 Basically an Occasional Poster Featured Poster

I tried LitJSON only to find out that it's probably compiled using .NET 2.0. I'm working in 1.1.
In my latest attempt I used Jayrock.
And i've also been ripping my hair out trying to get the method JavaScriptDeserializerFromJson in AjaxPro to do my bidding.
No suck luck.

I'm trying to convert the json string into a .NET object in the form of a custom class.

The incoming Json string can contain an array, or not.
But either way I always get an exception thrown in my face.
With Jayrock the error is: "Cannot import System.<whatever> from a JSON Object value".
With AjaxPro there's not always an error but the object is not filled. However, when there is an error it's usually something along the lines of "invalid cast".

Here's two of my attempts:

Dim app As Appartements
'Dim app As String

Try
app = AjaxPro.JavaScriptDeserializer.DeserializeFromJson(jsonString, _
GetType(Appartements)) '//AjaxPro
'app = JsonConvert.Import(GetType(String), jsonString) '//Jayrock
...............

<Serializable()> _
Public Class Appartements
Public strAppNr As String = ""
Public strAppFloor As String = ""
Public strUnitPlace As String = ""
Public strConsID As String = ""
Public strUnitNr As String = ""
Public strUnitSet As String = ""
Public strFuse As String = ""
Public strCustomer As String = ""
Public strDOB As String = ""
End Class

Am I doing something wrong or am i totally incompetent? :)

Oxiegen 88 Basically an Occasional Poster Featured Poster

Ok. So it works. I now get a correct json string.
Now I'll have to figure out how to Deserialize(?) it in server code-behind into a a use-able .NET object/class/structure.
Any suggestions?

Oxiegen 88 Basically an Occasional Poster Featured Poster

Sorry about that. Won't happen again.

I'll try your solution by adding the name element.
But I was just thinking. If that's the reason why it won't work, then why does the code capture and hold the string in the last form element of each row and not the others?

Oxiegen 88 Basically an Occasional Poster Featured Poster

Hello? Am I forgotten?