Forum

hugo7 Messages postés 352 Date d'inscription samedi 11 décembre 2010 Statut Membre Dernière intervention 29 juin 2011 - 18 oct. 2008 à 15:15
hugo7 Messages postés 352 Date d'inscription samedi 11 décembre 2010 Statut Membre Dernière intervention 29 juin 2011 - 18 oct. 2008 à 19:05
Bonjour à tous je voudrais savoir comment créer un forum qui utilise une base sql server( et non mysql) ?
Si quelqu'un aurait une source , un livre, un tutoriels se serait bien.
Merci d'avances pour vos réponses.

5 réponses

cretthie Messages postés 133 Date d'inscription mercredi 27 juin 2012 Statut Membre Dernière intervention 10 janvier 2012 1
18 oct. 2008 à 16:39
Salut mec,

Je passe par la et ce matin, je suis tombé sur un truc pour les forums...

regarde un peu ce lien, le bbcode est un truc expres pour les forum.
A plus.
http://fr.wikipedia.org/wiki/BBCode
0
cretthie Messages postés 133 Date d'inscription mercredi 27 juin 2012 Statut Membre Dernière intervention 10 janvier 2012 1
18 oct. 2008 à 16:45
ouai, voila, c'est un truc que j'ai mis il y a longtemps
http://www.vbfrance.com/forum/sujet-PB-CREATION-PROCEDURE-STOCKEES_1022758.aspx

c'est pour te connecter a ta base il reste plus qu'a rajouter le constr sinon, tout est si je me souviens bien

C'est en vb, mais le principe est le meme.

a plus
0
cretthie Messages postés 133 Date d'inscription mercredi 27 juin 2012 Statut Membre Dernière intervention 10 janvier 2012 1
18 oct. 2008 à 16:54
voila, dans le lien que je t'ai donné, il faut changer :
My.Settings.GCLConnectionString par ta chaine de connection.

ouai, il manque le sqlHelper : le voila :




Option








Strict





OnImports



Microsoft.VisualBasic



Public








Class

SqlHelper



Private

m_strConnectionString


As





String

=


""








Public





Property

connectionString()


As





String








Get








Return

m_strConnectionString



End





Get








Set

(


ByVal

value


As





String

)m_strConnectionString = value



End





Set








End





Property








Public





Sub





New

()



End





Sub








Public





Sub





New

(


ByVal

ConnectionString


As





String

)m_strConnectionString = ConnectionString



End





Sub








Public





Function

GetDataSet(


ByVal

CommandType


As

System.Data.CommandType, _



ByVal

CommandText


As





String

, _



ByVal





ParamArray

CommandParameters()


As

System.Data.SqlClient.SqlParameter) _



As

System.Data.DataSet



Dim

objDataSet


As





New

System.Data.DataSet



Dim

objConnection


As





New

System.Data.SqlClient.SqlConnection



Dim

objCommand


As





New

System.Data.SqlClient.SqlCommand



Dim

objAdapter


As





New

System.Data.SqlClient.SqlDataAdapter



Try


objConnection.ConnectionString =





Me

.connectionStringobjConnection.Open()

objCommand.Connection = objConnection

objCommand.CommandType = CommandType

objCommand.CommandText = CommandText



If





Not

CommandParameters


Is





Nothing





Then








For





Each

parameter


As

System.Data.SqlClient.SqlParameter


In

CommandParametersobjCommand.Parameters.Add(parameter)



Next








End





If


objAdapter.SelectCommand = objCommand


objAdapter.Fill(objDataSet)


objConnection.Close()








Catch

ex


As

Exception



Throw








End





Try








Return

objDataSet



End





Function








Public





Function

getDataTable(


ByVal

CommandType


As

System.Data.CommandType, _



ByVal

CommandText


As





String

, _



ByVal





ParamArray

CommandParameters()


As

System.Data.SqlClient.SqlParameter) _



As

System.Data.DataTable



Dim

dsResults


As

System.Data.DataSet =


Me

.GetDataSet(CommandType, CommandText, CommandParameters)



If





Not

dsResults


Is





Nothing





AndAlso

dsResults.Tables.Count > 0


Then








Return

dsResults.Tables(0)



Else








Return





Nothing








End





If








End





Function








Public





Function

gestDataRow(


ByVal

CommandType


As

System.Data.CommandType, _



ByVal

CommandText


As





String

, _



ByVal





ParamArray

CommandParameters()


As

System.Data.SqlClient.SqlParameter) _



As

System.Data.DataRow



Dim

dtResults


As

System.Data.DataTable =


Me

.getDataTable(CommandType, CommandText, CommandParameters)



If





Not

dtResults


Is





Nothing





AndAlso

dtResults.Rows.Count > 0


Then








Return

dtResults.Rows(0)



Else








Return





Nothing








End





If








End





Function








Public





Function

ExecuteScalar(


ByVal

CommandType


As

System.Data.CommandType, _



ByVal

CommandText


As





String

, _



ByVal





ParamArray

CommandParameters()


As

System.Data.SqlClient.SqlParameter) _



As





Object








Dim

objResult


As





Object








Dim

objConnection


As





New

System.Data.SqlClient.SqlConnection



Dim

objCommand


As





New

System.Data.SqlClient.SqlCommand



Try


objConnection.ConnectionString =





Me

.connectionStringobjConnection.Open()

objCommand.Connection = objConnection

objCommand.CommandType = CommandType

objCommand.CommandText = CommandText



If





Not

CommandParameters


Is





Nothing





Then








For





Each

Parameter


As

System.Data.SqlClient.SqlParameter


In

CommandParametersobjCommand.Parameters.Add(Parameter)



Next








End





If


objResult = objCommand.ExecuteScalar


objConnection.Close()








Catch

ex


As

Exception



Throw








End





Try








Return

objResult



End





Function








Public





Function

ExecuteNonQuery(


ByVal

CommandType


As

System.Data.CommandType, _



ByVal

CommandText


As





String

, _



ByVal





ParamArray

CommandParameters()


As

System.Data.SqlClient.SqlParameter) _



As





Integer








Dim

intResult


As





Integer








Dim

objConnection


As





New

System.Data.SqlClient.SqlConnection



Dim

objCommand


As





New

System.Data.SqlClient.SqlCommand



Try


objConnection.ConnectionString =





Me

.connectionStringobjConnection.Open()

objCommand.Connection = objConnection

objCommand.CommandType = CommandType

objCommand.CommandText = CommandText



If





Not

CommandParameters


Is





Nothing





Then








For





Each

parameter


As

System.Data.SqlClient.SqlParameter


In

CommandParametersobjCommand.Parameters.Add(parameter)



Next








End





If


intResult = objCommand.ExecuteNonQuery


objConnection.Close()








Catch

ex


As

Exception



Throw








End





Try








Return

intResult



End





FunctionEnd







Class
0
cretthie Messages postés 133 Date d'inscription mercredi 27 juin 2012 Statut Membre Dernière intervention 10 janvier 2012 1
18 oct. 2008 à 16:55
a préciser, mes sources vienne du bouquin qui est conseillé sur le site : ! ! !

soit : le guide complet vb / microapp
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
hugo7 Messages postés 352 Date d'inscription samedi 11 décembre 2010 Statut Membre Dernière intervention 29 juin 2011
18 oct. 2008 à 19:05
Ok merci beaucoup cretthie je vois se que je peut faire+
0
Rejoignez-nous