Gojko Bozic <> wrote:
> Hi,
>
> Need some simple but complete example of Webform with free VFP table
> behind.
>
> 1. I am using VWD 2005 Express Edit.
> 2. Connect string is defined in the web.config 3. On the form there
> are 2 ( or more, but > 1 !) fields 4. There is a submit/add button on
> the form 5. The user just sends ( name, e_mail - ofcourse ...) data
> back to table 6. Fields on the form are cleared and wait for new data
> 7. Code in C# should be in separate file
>
> (Yes, I have many texts about ADO.NET and VFP but I can't just do
> such a form quickly and in the most simpliest way at this moment).
Are you looking for how to communicate between ASP.Net and VFP?
In the Click make a reference to a dataLoad function.
private void MyButton_Click(object sender, System.EventArgs e)
{
int KeyID = 101 // Get your key loaded how ever you need it
dataLoad(KeyID); // You pass the key of data row
you wanted here.
}
public void dataLoad(int iKey)
{
string strConnection = "Provider=vfpoledb.1;Data
Source=C:\MyDataDirectory\;Collating Sequence=general;"
// Stuff your going after
string strSQL = "SELECT MyFields from Mytale where
ID = " +Convert.ToString(iKey);
SqlConnection objConnection = new
SqlConnection(strConnection);
SqlCommand objCommand = new SqlCommand(strSQL,
objConnection);
objConnection.Open();
// I am taking the data and filling a listbox from
my source but you
// could put it in a table or in a dataset and then
in a table.
MyDropDownList1.DataSource =
objCommand.ExecuteReader();
MyDropDownList1.DataTextField = "ma_applpg";
//What I will display
MyDropDownList1.DataValueField = "ma_ID";
//What is it's KEY
MyDropDownList1.DataBind();
objConnection.Close();
objConnection.Dispose();
}
Stephen Russell
DBA / .Net Developer
Memphis TN 38115
901.246-0159
"Our scientific power has outrun our spiritual power. We have guided
missiles and misguided men." Dr. Martin Luther King Jr.
http://spaces.msn.com/members/srussell/
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.15.14/578 - Release Date: 12/7/2006
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.