Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem updating tables from Stored Procedure
Message
 
 
À
27/06/2006 12:14:26
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01132012
Message ID:
01132073
Vues:
18
>Dmitry,
>For a check I quickly did this one (testdata.dbc):
>
>Procedure AddCustomer
>USE testdata!customer In 0 Alias myCustomer
>Append Blank in 'myCustomer'
>replace cust_id with Right(Sys(2015),6),Company with ".Net company-"+Ttoc(Datetime(),1)
>use
>endproc
>
>
>ASP.Net page with a single button to call procedure:
>
>    protected void Button1_Click(object sender, EventArgs e)
>    {
>	string strConn = "Provider=VFPOLEDB.1;Data source=d:\\temp\\testdata.dbc;";
>	OleDbConnection cn = new OleDbConnection(strConn);
>	cn.Open();
>	OleDbCommand cmd = cn.CreateCommand();
>        cmd.CommandType = CommandType.StoredProcedure;
>	cmd.CommandText = "AddCustomer";
>	cmd.ExecuteNonQuery();
>        cn.Close();
>    }
>
It worked. Each time I click I get a new customer.

Cetin,

You are amazing that you can create this code on-the-fly in just a few seconds. Thank you.

On your other comment:

>>
DataFolder is my suspicion. I used myDBC!myTable style.
>>

my table is a FREE table so I can't use the syntax myDbf!myTable.

But I will try your code with button click method.

Thank you very much.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform