ndeniche 402 Posting Virtuoso Featured Poster

Hi guys.

I know this is a long shot, but does anyone know if parallel computing (multiple simultaneous programmers/developers working on the same file) is possible for SQL databases?

What I'm wondering if is possible is working on a local database that updates the mdf file in two computers, which have their own local SQL servers.

Any thoughts?

ndeniche 402 Posting Virtuoso Featured Poster

Hello guys.

I'm using a Microsoft Word form template to create objects in a form programatically, so depending on the information read by the program from the template.

So, I've got some fields where I store formula data for the form, in which I specify that the value for that field is obtained by multiplying other fields in the template. So I store in the string something like this:

"Text1.Text * Text2.Text"

So I need to convert these string values into variable calls to actually operate these values.

What would be the best way to do this?

ndeniche 402 Posting Virtuoso Featured Poster

Hello guys.

I'm developing a web application in which I have to connect to a mssql server which is connected through a proxy server. I have allowed data transfers for the MSSQLSERVER service, and allowed connections for port 1433. I've read that this is absolutely insecure, and it still gives me mssql_connect() errors, so which one is the best way to do this?

Thanks in advance

ndeniche 402 Posting Virtuoso Featured Poster

so, if I input 5 it should count 5,10,15,20,25 or 1,2,3,4,5 ?

ndeniche 402 Posting Virtuoso Featured Poster

Also, remember wrapping your code in [code]

[/code] tags. Like this:

[code=C] int main() { while(1) { doesLove(you); } }

doesLove(String str) { printf("I love %s!", str); }

[/code]

ndeniche 402 Posting Virtuoso Featured Poster

Add quotation marks ("") around you so the compiler won't expect a variable named you ;)

ndeniche 402 Posting Virtuoso Featured Poster

You can check out this snippet and edit it for email validation.

ndeniche 402 Posting Virtuoso Featured Poster

you can do this perfectly in php, though you'd have to create an array for the different weeky values. Better do this with a sql query, using sum(column) and a group by clause.

ndeniche 402 Posting Virtuoso Featured Poster

Let me see if i got this straight:

What you want to do is accumulate the weeky count for each week in all the part numbers? As to see how many parts per week you have?

ndeniche 402 Posting Virtuoso Featured Poster

Have you already tried count($datasq["$part_no"]) ?

Also, if $part_no is a number, there is no need for double quotation marks. You can just call it by numeric association.

ndeniche 402 Posting Virtuoso Featured Poster

Try storing the value for the div's id in a hidden input. This way, you can access the value by calling the hidden value associated with the div.

ndeniche 402 Posting Virtuoso Featured Poster

ooh... totally forgot about the minus sign :P... Thanks for the collaboration

ndeniche 402 Posting Virtuoso Featured Poster

What about showing a messagebox with the error in the exception? That way, even though you handle it, you can know what it is

ndeniche 402 Posting Virtuoso Featured Poster

Well, post your codes then, and lets see what we can do

ndeniche 402 Posting Virtuoso Featured Poster

switch the quotation marks in the query, since mysql won't take quotations (" ").

$insertquery = "insert into users(Name, password, email) values('" . $_POST['Name']
               . "', '" . sha1($_POST['Password'] . "', '" . $_POST['email'] . "')";
ndeniche 402 Posting Virtuoso Featured Poster

You are just missing the validation

Dim check As Boolean
    For i as Integer = 0 To dataGrid1.rows.count

    check = DataGridView1.Rows(i).Cells(0).Value

    If check Then
        Exit For
    End If

    Next

    If Not check Then
        MessageBox.Show("You didn't check any checkbox")
    End If
ndeniche 402 Posting Virtuoso Featured Poster

can you post your latest code?

ndeniche 402 Posting Virtuoso Featured Poster

After changing the range for the cycle? Make sure it stops at dataGridView1.Rows.Count -1 .

Try putting a Breakpoint (for debugging) at the start of the cycle so you can check how many times it is repeating and thus identify the error's cause

ndeniche 402 Posting Virtuoso Featured Poster

Oh... I see the problem. Change the following line:

For i as Integer = 0 To dataGridView1.Rows.Count - 1

Since the array of rows starts from 0, and in the case of your datagridview ends in 3 (0, 1, 2, 3)

ndeniche 402 Posting Virtuoso Featured Poster

try switching "chk" for 0

ndeniche 402 Posting Virtuoso Featured Poster

Also, try to standarize your quotation marks and colons, since you tend to use both for the same thing:

$passwordHash = strip_tags($_POST["Password"]);
$repeatpassword= strip_tags($_POST['Password2']);

Try doing both like this always:

$passwordHash = strip_tags($_POST['Password']);
$repeatpassword= strip_tags($_POST['Password2']);

Or like this:

$passwordHash = strip_tags($_POST["Password"]);
$repeatpassword= strip_tags($_POST["Password2"]);

Besides, you declared the variables and assigned them the $_POST values, but you didn't use them.

ndeniche 402 Posting Virtuoso Featured Poster

You have to specify a connection to the mysql_query function:

mysql_query($insertquery, $connection);
ndeniche 402 Posting Virtuoso Featured Poster

how did you enter the .Cells() parameter?

ndeniche 402 Posting Virtuoso Featured Poster

the index is the column number in the cell array (which composes the row). Each cell has a header (or title) which was specified when you specified how many (or which) columns were in the datagrid.

If you don't know what's the name of the column, simply enter (instead of .Cells["checkbox"] ) the number of the column (starting your count by 0) .Cells[0]

ndeniche 402 Posting Virtuoso Featured Poster

Sorry... Let me correct that code. (I got mixed up the language :P)

Dim check As Boolean
For i as Integer = 0 To dataGrid1.rows.count
    check = DataGridView1.Rows(i).Cells("checkbox").Value 'checkbox being the name of the column
                                                        'you can access it by index as well
Next
If check Then
    MessageBox.Show("You didn't check any checkbox")
End If
ndeniche 402 Posting Virtuoso Featured Poster

Try Password , capitalizing the first letter, as in the input's name

ndeniche 402 Posting Virtuoso Featured Poster

First of all, there's no need to start two threads for the same matter.

Second, try using <input type="button" onclick="action()" value="Button" /> instead of submit buttons. That way, you can control better the actions of each button, instead of submitting the form.

What's the difference? The type="submit" button submits the form (which means it takes the action specified in the <form action="#"> tag. The button does what you specify in the button events.

ndeniche 402 Posting Virtuoso Featured Poster

I want to make an infinite power source for my house. What's your point?

ndeniche 402 Posting Virtuoso Featured Poster

Lol... Thought it was a more complex concept... I do recall the yellow design. (Actually tried to copy it once, I admit).

In accordance to the subject, why were the user badges removed from the certificates?. Why not show in them who is "special" in DW?

ndeniche 402 Posting Virtuoso Featured Poster

you can go through the whole datagrid (meaning the rows in the datagrid) assigning the checked of the checkbox column. At the end of the cycle, if any of the ceckboxes is checked, your boolean will be true.

Like this:

Dim check As Boolean
For i as Integer = 0 To dataGrid1.rows.count
    check = datagrid1.rows[i].cells["checkbox"].checked 'checkbox being the name of the column
Next
If check Then
    MessageBox.Show("You didn't check any checkbox")
End If
ndeniche 402 Posting Virtuoso Featured Poster

It seems to me i'm a little out of date... I don't recall the multiple badges to select from, neither the "purple wars"... Could someone explain plox? :P

ndeniche 402 Posting Virtuoso Featured Poster

Nevermind. Found a solution. I created an array for the xmlhttprequest variables, so each would have its independent page request. I realized I didn't need the responseText, so I deleted that part.

Here it is:

function guardarProceso(id)
{
	
	var table = document.getElementById('candidatos');
	
	var num = table.rows.length - 1;
	
	var xmlhttpNew = new Array();
	
	for (i = 0; i < num; i++)
	{
		if (window.XMLHttpRequest)
		{// code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttpNew[i]=new XMLHttpRequest();
		}
		else
		{// code for IE6, IE5
		  xmlhttpNew[i]=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
			
	if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttpNew[i]=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
	  xmlhttpNew[i]=new ActiveXObject("Microsoft.XMLHTTP");
	}
		
	row = table.rows[i+1];
	params = "?num=" + id + "&id=" + row.cells[0].innerHTML;
	params += "&nom=" + row.cells[1].innerHTML + "&tel=" + row.cells[2].innerHTML;
	params += "&dir=" + row.cells[3].innerHTML + "&otros=" + row.cells[4].innerHTML;
	params += "&sc=" + row.cells[5].innerHTML;

	xmlhttpNew[i].open("get","php_functions/agregarCandidato.php" + params,true);
	xmlhttpNew[i].send();			
	
	}
}
ndeniche 402 Posting Virtuoso Featured Poster

Ok, so I've come up to this:

function guardarProceso(id)
{
	
        //get table
	var table = document.getElementById('candidatos');
	
	var num = table.rows.length - 1;

	//sentinel that checks if php request returned successfully	
	sent = false;
	
	for(i = 0; i < num; )
	{
                //cycle will repeat itself until the xmlhttprequest's variable
                //readystate and status are 4 and 200

                //this validation prevents the script from assigning values to
                //parameters and sending the request over and over
		if(!sent)
		{
			sent = true;

			//Create xmlhttprequest variable
			if (window.XMLHttpRequest)
			{// code for IE7+, Firefox, Chrome, Opera, Safari
			  xmlhttpNew=new XMLHttpRequest();
			}
			else
			{// code for IE6, IE5
			  xmlhttpNew=new ActiveXObject("Microsoft.XMLHTTP");
			}

			//get row data
			row = table.rows[i+1];

                        //parameters for php
			params = "?num=" + id + "&id=" + row.cells[0].innerHTML;
			params += "&nom=" + row.cells[1].innerHTML + "&tel=" + row.cells[2].innerHTML;
			params += "&dir=" + row.cells[3].innerHTML + "&otros=" + row.cells[4].innerHTML;
			params += "&sc=" + row.cells[5].innerHTML;
		
                        //the php is a simple insert function that returns the
                        //inserted record's id
		        xmlhttpNew.open("get","php_functions/agregarCandidato.php" + params,true);
			xmlhttpNew.send();			
		}

		//check for request state event
		xmlhttpNew.onreadystatechange=function()
		{
		  if (xmlhttpNew.readyState==4 && xmlhttpNew.status==200)
		  {
                        //show me the request's message (which should be the
                        //record's id in the database)
		  	alert(xmlhttpNew.responseText);

                        //add to row counter
		  	i++;

                        //allow for parameter creation and request sending
		 	sent = false
			
		  }
		
		}
		
	}
}

After executing this script, the browser successfully inserts the first row in the table, but runs into an infinite cycle in the second one. I honestly don't see where i'm missing the spot.

Any help would be eternally appreciated :D

ndeniche 402 Posting Virtuoso Featured Poster

Hello peeps.

I'm trying to update a sql table from mi php Ajax web page, which stores dynamically a table into the page by table.appendChild(row) , so that the user can verify the information he is inserting before the actual database update.

How do I do this with ajax?

ndeniche 402 Posting Virtuoso Featured Poster

I can see that you have a block display in the unordered list. The only thing remaining to check is if the cursor allows clicking on the link in the surroundings of the link.

ndeniche 402 Posting Virtuoso Featured Poster

the simple example is nothing but an empty link to demonstrate how links behave normally, without any css.

Now, see the navigation menu down there? It is an unordered list, formatted to be aligned in block, and styled so that the links are surrounded by color and a box that follows the same link.

Let me know if you got it this time.

ndeniche 402 Posting Virtuoso Featured Poster

Have you even started coding any of it?

ndeniche 402 Posting Virtuoso Featured Poster

It means that, unlike the simple link, you can click on an option by placing the pointer around the text, as in the buttons in the bottom bar of this site.

ndeniche 402 Posting Virtuoso Featured Poster

Just sayin'...

Coincidence?

ndeniche 402 Posting Virtuoso Featured Poster

For memsize As Integer = 0 To 8
memList(memsize).name = sr.ReadLine
memList(memsize).num = sr.ReadLine
Next

Your array measures 8... Count the for cycle from 0 to 7

ndeniche 402 Posting Virtuoso Featured Poster

Wouldn't it make your database more efficient if you stored the image file in the server and just stored the image's address in the database instead?

ndeniche 402 Posting Virtuoso Featured Poster

Microsoft Expression Studio works pretty well too. The thing is, I only use web design software for the intellisense and the code formatting, since I wite every single line of code in my design (This way, when there's an error in my code, I'm most likely to know exactly where the problem is).

Expression Web does a pretty good job at precisely that, plus it has a feature that allows you to see your code parsed in real time

ndeniche 402 Posting Virtuoso Featured Poster

This snippet is to create a user control that will only take numbers. Numbers will accept decimal values, for which the NumberBox is validated to take only one.

The implementation for the control is the same as it is for the TextBox, since it is inherited from this class and uses all of its attributes and methods:

Private Sub InitializeComponent()
    'Initialize Object with the constructor for the class
    '[UserControls] is the Library in which the class is created
    Me.NumBox1 = New UserControls.NumberBox()
    '
    'NumBox1
    '
    Me.NumBox1.Location = New System.Drawing.Point(45, 75)
    Me.NumBox1.Name = "NumberBox"
    Me.Numbox1.Size = New System.Drawing.Size(100, 20)
    Me.NumBox1.TabIndex = 0
    '
    'Form1
    '
    'Add Control to form
    Me.Controls.Add(Me.NumBox1)

End Sub
Friend WithEvents NumBox1 As UserControls.NumberBox
ndeniche 402 Posting Virtuoso Featured Poster

you have to specify all the columns in order to compare them with the search string

ndeniche 402 Posting Virtuoso Featured Poster

no you can't. You have to specify which columns you wish to compare, since MySQL cannot process that command.

ndeniche 402 Posting Virtuoso Featured Poster

Works fine for me..

First one is firefox, second is IE

ndeniche 402 Posting Virtuoso Featured Poster

Try AJAX. It will not refresh the webpage, though it will send a separate request to the server asking for the information you need.

function showRecords(str)
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("messagesDiv").innerHTML="Messages (" . xmlhttp.responseText . ")";
    }
  }
xmlhttp.open("GET","getrecords.php",true);
xmlhttp.send();
}

so getrecords.php contains the php code that queries the database for new records, and you call the javascript unction every 2 seconds. document.getElementById["messagesDiv"] refers to an html container with that id, which reflects the quantity of records in the database.

ndeniche 402 Posting Virtuoso Featured Poster

try wrapping everything into a

<div class="wrapper">
...
</div>

container, with the following properties (or you can play with your own):

.wrapper
{
    width:1000px;
    left:0;
    right:0;

    margin-left:auto;
    margin-right:auto;
}

Next, remove the margin-right from your nav menu.

The wrapper will act as a margin guide for the rest of the document, so the alignment for the elements will therefore be automatic.

ndeniche 402 Posting Virtuoso Featured Poster

Try removing line 55. The data print into the page counts as a page header, so the header("location...") function won't work.

ndeniche 402 Posting Virtuoso Featured Poster

I personally rather use SQL Sqrver, since integration with .NET is almost seamless, and it's got pretty easy to use tools... Look for the msdn sheet on connecting to SQL Server in microsoft's site